diff options
| author | Gyorgy Sarvari <skandigraun@gmail.com> | 2026-01-15 09:29:11 +0100 |
|---|---|---|
| committer | Gyorgy Sarvari <skandigraun@gmail.com> | 2026-01-15 13:50:53 +0100 |
| commit | 5e11a2eba710d0d277f56a4f48e93e9b0f6cf5fa (patch) | |
| tree | 26b2ecf9c9aaf40c4bf41f1a6235d6c879d4cb8b /meta-python | |
| parent | 6d3dcbce79a30772ec9ce48fdfede258513c313a (diff) | |
| download | meta-openembedded-5e11a2eba710d0d277f56a4f48e93e9b0f6cf5fa.tar.gz | |
python3-django: fix hostname length validation in URLvalidator
This patch is for python3-django_2.2.28
The hostname's length has been incorrectly validated, it was checking
an incorrect section of the URL, this made a testcase fail.
This backported patch mitigates this issue.
Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com>
Diffstat (limited to 'meta-python')
| -rw-r--r-- | meta-python/recipes-devtools/python/python3-django/0001-Fixed-32298-Fixed-URLValidator-hostname-length-valid.patch | 30 | ||||
| -rw-r--r-- | meta-python/recipes-devtools/python/python3-django_2.2.28.bb | 1 |
2 files changed, 31 insertions, 0 deletions
diff --git a/meta-python/recipes-devtools/python/python3-django/0001-Fixed-32298-Fixed-URLValidator-hostname-length-valid.patch b/meta-python/recipes-devtools/python/python3-django/0001-Fixed-32298-Fixed-URLValidator-hostname-length-valid.patch new file mode 100644 index 0000000000..8cab678a36 --- /dev/null +++ b/meta-python/recipes-devtools/python/python3-django/0001-Fixed-32298-Fixed-URLValidator-hostname-length-valid.patch | |||
| @@ -0,0 +1,30 @@ | |||
| 1 | From ee35cb8dd2f903ddde115ca10186e162ffd8dc62 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Gyorgy Sarvari <skandigraun@gmail.com> | ||
| 3 | Date: Sat, 26 Dec 2020 20:52:44 +0530 | ||
| 4 | Subject: [PATCH] Fixed #32298 -- Fixed URLValidator hostname length | ||
| 5 | validation. | ||
| 6 | |||
| 7 | From: Akshat1Nar <akshat.dixit71@gmail.com> | ||
| 8 | |||
| 9 | URLValidator now validates the maximum length of a hostname without | ||
| 10 | the userinfo and port. | ||
| 11 | |||
| 12 | Upstream-Status: Backport [https://github.com/django/django/commit/b41d38ae26b1da9519a6cd765bc2f2ce7d355007] | ||
| 13 | Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com> | ||
| 14 | --- | ||
| 15 | django/core/validators.py | 2 +- | ||
| 16 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
| 17 | |||
| 18 | diff --git a/django/core/validators.py b/django/core/validators.py | ||
| 19 | index 2dbd3bf..94cc3bf 100644 | ||
| 20 | --- a/django/core/validators.py | ||
| 21 | +++ b/django/core/validators.py | ||
| 22 | @@ -151,7 +151,7 @@ class URLValidator(RegexValidator): | ||
| 23 | # section 3.1. It's defined to be 255 bytes or less, but this includes | ||
| 24 | # one byte for the length of the name and one byte for the trailing dot | ||
| 25 | # that's used to indicate absolute names in DNS. | ||
| 26 | - if len(urlsplit(value).netloc) > 253: | ||
| 27 | + if len(urlsplit(value).hostname) > 253: | ||
| 28 | raise ValidationError(self.message, code=self.code) | ||
| 29 | |||
| 30 | |||
diff --git a/meta-python/recipes-devtools/python/python3-django_2.2.28.bb b/meta-python/recipes-devtools/python/python3-django_2.2.28.bb index 3dd64a5507..bf7e182aba 100644 --- a/meta-python/recipes-devtools/python/python3-django_2.2.28.bb +++ b/meta-python/recipes-devtools/python/python3-django_2.2.28.bb | |||
| @@ -37,6 +37,7 @@ SRC_URI += "file://CVE-2023-31047.patch \ | |||
| 37 | file://0001-Fixed-35172-Fixed-intcomma-for-string-floats.patch \ | 37 | file://0001-Fixed-35172-Fixed-intcomma-for-string-floats.patch \ |
| 38 | file://0001-implement-group-method-for-FakeMatch.patch \ | 38 | file://0001-implement-group-method-for-FakeMatch.patch \ |
| 39 | file://0001-fix-ipv6-test.patch \ | 39 | file://0001-fix-ipv6-test.patch \ |
| 40 | file://0001-Fixed-32298-Fixed-URLValidator-hostname-length-valid.patch \ | ||
| 40 | " | 41 | " |
| 41 | 42 | ||
| 42 | SRC_URI[sha256sum] = "0200b657afbf1bc08003845ddda053c7641b9b24951e52acd51f6abda33a7413" | 43 | SRC_URI[sha256sum] = "0200b657afbf1bc08003845ddda053c7641b9b24951e52acd51f6abda33a7413" |
