summaryrefslogtreecommitdiffstats
path: root/meta-python/recipes-devtools/python/python3-twisted/CVE-2022-24801-7.patch
blob: 3fb4f432b48c8110acb2a0b4443bbbec3dc96451 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
From a2fd35cf03bd3a847fd47a6f1a812e359c2dafda Mon Sep 17 00:00:00 2001
From: Tom Most <twm@freecog.net>
Date: Sun, 13 Mar 2022 23:57:23 -0700
Subject: [PATCH] Remove unreachable branch

Upstream-Status: Backport [https://github.com/twisted/twisted/commit/696bfeaf5a1fa7ff952f860c89e2bdcfacef7d7a]
CVE: CVE-2022-24801
Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com>
---
 src/twisted/web/http.py | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/src/twisted/web/http.py b/src/twisted/web/http.py
index 940ff9f..ea77f57 100644
--- a/src/twisted/web/http.py
+++ b/src/twisted/web/http.py
@@ -1915,9 +1915,7 @@ class _ChunkedTransferDecoder:
         except ValueError:
             raise _MalformedChunkedDataError("Chunk-size must be an integer.")
 
-        if length < 0:
-            raise _MalformedChunkedDataError("Chunk-size must not be negative.")
-        elif length == 0:
+        if length == 0:
             self.state = "TRAILER"
         else:
             self.state = "BODY"