diff --git a/.github/workflows/cifuzz.yml b/.github/workflows/cifuzz.yml new file mode 100644 index 0000000..a30d324 --- /dev/null +++ b/.github/workflows/cifuzz.yml @@ -0,0 +1,27 @@ +name: CIFuzz +on: + pull_request: + branches: + - 'release/**' +jobs: + Fuzzing: + runs-on: ubuntu-latest + steps: + - name: Build Fuzzers + id: build + uses: google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@master + with: + oss-fuzz-project-name: 'python-multipart' + language: python + - name: Run Fuzzers + uses: google/oss-fuzz/infra/cifuzz/actions/run_fuzzers@master + with: + oss-fuzz-project-name: 'python-multipart' + language: python + fuzz-seconds: 300 + - name: Upload Crash + uses: actions/upload-artifact@v3 + if: failure() && steps.build.outcome == 'success' + with: + name: artifacts + path: ./out/artifacts diff --git a/python_multipart/multipart.py b/python_multipart/multipart.py index f26a815..6c84829 100644 --- a/python_multipart/multipart.py +++ b/python_multipart/multipart.py @@ -1241,7 +1241,7 @@ def data_callback(name: CallbackName, end_i: int, remaining: bool = False) -> No elif state == MultipartState.HEADER_VALUE_ALMOST_DONE: # The last character should be a LF. If not, it's an error. if c != LF: - msg = "Did not find LF character at end of header " "(found %r)" % (c,) + msg = "Did not find LF character at end of header (found %r)" % (c,) self.logger.warning(msg) e = MultipartParseError(msg) e.offset = i