ReDos via excessive backtracking while parsing header values (bsc#1230227, CVE-2024-6232). OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:Factory/python?expand=0&rev=425
15 lines
758 B
Diff
15 lines
758 B
Diff
--- a/Lib/gettext.py
|
|
+++ b/Lib/gettext.py
|
|
@@ -387,8 +387,9 @@ class GNUTranslations(NullTranslations):
|
|
self._charset = v.split('charset=')[1]
|
|
elif k == 'plural-forms':
|
|
v = v.split(';')
|
|
- plural = v[1].split('plural=')[1]
|
|
- self.plural = c2py(plural)
|
|
+ if len(v) > 1:
|
|
+ plural = v[1].split('plural=')[1]
|
|
+ self.plural = c2py(plural)
|
|
# Note: we unconditionally convert both msgids and msgstrs to
|
|
# Unicode using the character encoding specified in the charset
|
|
# parameter of the Content-Type header. The gettext documentation
|