-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
python-multipart: fix fuzz blocker (#12221)
Fixes: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=67660 (Fuzz-Blocker) This is a temp fix, till Kludex/python-multipart#141 lands.
- Loading branch information
Showing
3 changed files
with
15 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
diff --git a/multipart/multipart.py b/multipart/multipart.py | ||
index 0bf35c3..2a0e01c 100644 | ||
--- a/multipart/multipart.py | ||
+++ b/multipart/multipart.py | ||
@@ -1167,7 +1167,7 @@ class MultipartParser(BaseParser): | ||
# If we've reached a CR at the beginning of a header, it means | ||
# that we've reached the second of 2 newlines, and so there are | ||
# no more headers to parse. | ||
- if c == CR: | ||
+ if c == CR and index == 0: | ||
delete_mark("header_field") | ||
state = MultipartState.HEADERS_ALMOST_DONE | ||
i += 1 |