diff --git a/.github/workflows/crunch42-analysis.yml b/.github/workflows/crunch42-analysis.yml new file mode 100644 index 0000000000..ac13fe8fab --- /dev/null +++ b/.github/workflows/crunch42-analysis.yml @@ -0,0 +1,42 @@ +name: "42Crunch REST API Static Security Testing" + +# follow standard Code Scanning triggers +on: + push: + branches: [ main ] + pull_request_target: + # The branches below must be a subset of the branches above + branches: [ main ] + schedule: + - cron: '19 4 * * 3' + +jobs: + rest-api-static-security-testing: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Install DOMjudge + run: .github/workflowscripts/baseinstall.sh + + - name: Dump the OpenAPI + run: .github/workflowscripts/getapi.sh + + - name: Find all other JSON files and delete those + run: | + rm -rf ./installdir/domserver/lib/vendor ./lib/vendor + rm -f ./doc/manual/sphinx-team.json ./doc/manual/sphinx-team.json + find ./ -name "*.json" + + - name: 42Crunch REST API Static Security Testing + uses: 42Crunch/api-security-audit-action@v1 + with: + # Follow these steps to configure API_SECRET https://docs.42crunch.com/latest/content/tasks/integrate_github_actions.htm + api-token: ${{ secrets.API_SECRET }} + min-score: 9 + # Upload results to Github code scanning + upload-to-code-scanning: true + # Github token for uploading the results + github-token: ${{ github.token }} + ignore-failures: false + diff --git a/.github/workflows/mayhem-api.yml b/.github/workflows/mayhem-api.yml index 6f4b8d7f36..acf379c8f1 100644 --- a/.github/workflows/mayhem-api.yml +++ b/.github/workflows/mayhem-api.yml @@ -1,6 +1,10 @@ name: "Mayhem API analysis" on: + push: + branches: [ main ] + pull_request_target: + branches: [ main ] schedule: - cron: '5 21 * * *' diff --git a/lib/lib.error.c b/lib/lib.error.c index 6ecee19198..5355bc95e9 100644 --- a/lib/lib.error.c +++ b/lib/lib.error.c @@ -23,6 +23,8 @@ #include #include #include +#include +#include /* Define va_copy macro if not available (ANSI C99 only). * memcpy() is fallback suggested by the autoconf manual, but doesn't @@ -63,8 +65,9 @@ char *printf_escape(const char *str) for(str_pos=0; str_pos