Skip to content

Commit b546fc6

Browse files
committed
fuzz: Add cifuzz
This PR adds [cifuzz](https://google.github.io/oss-fuzz/getting-started/continuous-integration/) action workflow which is a service provided by oss-fuzz where this project already runs, this helps in catching shallow bugs, regression or build breakage by running fuzzers on PR for ~5 minutes (excluding the build time) on 'release/**' branch.
1 parent 3e909f5 commit b546fc6

File tree

2 files changed

+27
-1
lines changed

2 files changed

+27
-1
lines changed

.github/workflows/cifuzz.yml

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: CIFuzz
2+
on:
3+
schedule:
4+
- cron: '0 12 * * 1' # 12pm Monday
5+
jobs:
6+
Fuzzing:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: Build Fuzzers
10+
id: build
11+
uses: google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@master
12+
with:
13+
oss-fuzz-project-name: 'python-multipart'
14+
language: python
15+
- name: Run Fuzzers
16+
uses: google/oss-fuzz/infra/cifuzz/actions/run_fuzzers@master
17+
with:
18+
oss-fuzz-project-name: 'python-multipart'
19+
language: python
20+
fuzz-seconds: 300
21+
- name: Upload Crash
22+
uses: actions/upload-artifact@v3
23+
if: failure() && steps.build.outcome == 'success'
24+
with:
25+
name: artifacts
26+
path: ./out/artifacts

python_multipart/multipart.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1241,7 +1241,7 @@ def data_callback(name: CallbackName, end_i: int, remaining: bool = False) -> No
12411241
elif state == MultipartState.HEADER_VALUE_ALMOST_DONE:
12421242
# The last character should be a LF. If not, it's an error.
12431243
if c != LF:
1244-
msg = "Did not find LF character at end of header " "(found %r)" % (c,)
1244+
msg = "Did not find LF character at end of header (found %r)" % (c,)
12451245
self.logger.warning(msg)
12461246
e = MultipartParseError(msg)
12471247
e.offset = i

0 commit comments

Comments
 (0)