<feed xmlns='http://www.w3.org/2005/Atom'>
<title>python.git/Python/initconfig.c, branch 3.8</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.</subtitle>
<id>http://dangofactory.net/cgit/cgit.cgi/Server/python.git/atom/Python/initconfig.c?h=3.8</id>
<link rel='self' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/atom/Python/initconfig.c?h=3.8'/>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/'/>
<updated>2022-10-04T18:57:06Z</updated>
<entry>
<title>[3.8] gh-96848: Fix -X int_max_str_digits option parsing (GH-96988) (GH-97575)</title>
<updated>2022-10-04T18:57:06Z</updated>
<author>
<name>Miss Islington (bot)</name>
<email>31488909+miss-islington@users.noreply.github.com</email>
</author>
<published>2022-10-04T18:57:06Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=18a0cdb2dc86452d8d75aac7e9bb610270979411'/>
<id>urn:sha1:18a0cdb2dc86452d8d75aac7e9bb610270979411</id>
<content type='text'>
Fix command line parsing: reject "-X int_max_str_digits" option with
no value (invalid) when the PYTHONINTMAXSTRDIGITS environment
variable is set to a valid limit.
(cherry picked from commit 41351662bcd21672d8ccfa62fe44d72027e6bcf8)

Co-authored-by: Victor Stinner &lt;vstinner@python.org&gt;</content>
</entry>
<entry>
<title>[3.8] gh-95778: CVE-2020-10735: Prevent DoS by very large int() (#96503)</title>
<updated>2022-09-05T20:26:09Z</updated>
<author>
<name>Gregory P. Smith</name>
<email>greg@krypto.org</email>
</author>
<published>2022-09-05T20:26:09Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=b5e331fdb38684808ffc540d53e8595bdc408b89'/>
<id>urn:sha1:b5e331fdb38684808ffc540d53e8595bdc408b89</id>
<content type='text'>
* Correctly pre-check for int-to-str conversion

Converting a large enough `int` to a decimal string raises `ValueError` as expected. However, the raise comes _after_ the quadratic-time base-conversion algorithm has run to completion. For effective DOS prevention, we need some kind of check before entering the quadratic-time loop. Oops! =)

The quick fix: essentially we catch _most_ values that exceed the threshold up front. Those that slip through will still be on the small side (read: sufficiently fast), and will get caught by the existing check so that the limit remains exact.

The justification for the current check. The C code check is:
```c
max_str_digits / (3 * PyLong_SHIFT) &lt;= (size_a - 11) / 10
```

In GitHub markdown math-speak, writing $M$ for `max_str_digits`, $L$ for `PyLong_SHIFT` and $s$ for `size_a`, that check is:
$$\left\lfloor\frac{M}{3L}\right\rfloor \le \left\lfloor\frac{s - 11}{10}\right\rfloor$$

From this it follows that
$$\frac{M}{3L} &lt; \frac{s-1}{10}$$
hence that
$$\frac{L(s-1)}{M} &gt; \frac{10}{3} &gt; \log_2(10).$$
So
$$2^{L(s-1)} &gt; 10^M.$$
But our input integer $a$ satisfies $|a| \ge 2^{L(s-1)}$, so $|a|$ is larger than $10^M$. This shows that we don't accidentally capture anything _below_ the intended limit in the check.

&lt;!-- gh-issue-number: gh-95778 --&gt;
* Issue: gh-95778
&lt;!-- /gh-issue-number --&gt;

Co-authored-by: Gregory P. Smith [Google LLC] &lt;greg@krypto.org&gt;
Co-authored-by: Christian Heimes &lt;christian@python.org&gt;
Co-authored-by: Mark Dickinson &lt;dickinsm@gmail.com&gt;</content>
</entry>
<entry>
<title>bpo-41819: Fix compiler warning in init_dump_ascii_wstr() (GH-22332)</title>
<updated>2020-10-21T08:55:38Z</updated>
<author>
<name>Miss Skeleton (bot)</name>
<email>31488909+miss-islington@users.noreply.github.com</email>
</author>
<published>2020-10-21T08:55:38Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=c756c2b507b088919ac0c1aa8b0d8c8bdbdd75ee'/>
<id>urn:sha1:c756c2b507b088919ac0c1aa8b0d8c8bdbdd75ee</id>
<content type='text'>
Fix the compiler warning:

format specifies type `wint_t` (aka `int`) but the argument has type `unsigned int`
(cherry picked from commit c322948892438a387d752ec18d1eb512699a4d67)

Co-authored-by: Samuel Marks &lt;807580+SamuelMarks@users.noreply.github.com&gt;</content>
</entry>
<entry>
<title>Fix compiler warnings in init_dump_ascii_wstr() (GH-22150)</title>
<updated>2020-09-09T10:26:32Z</updated>
<author>
<name>Miss Islington (bot)</name>
<email>31488909+miss-islington@users.noreply.github.com</email>
</author>
<published>2020-09-09T10:26:32Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=23d3681671bb538ef69c65875b68d59f6b756e61'/>
<id>urn:sha1:23d3681671bb538ef69c65875b68d59f6b756e61</id>
<content type='text'>
Fix GCC 9.3 (using -O3) warnings on x86:

initconfig.c: In function ‘init_dump_ascii_wstr’:
initconfig.c:2679:34: warning: format ‘%lc’ expects argument of type
‘wint_t’, but argument 2 has type ‘wchar_t’ {aka ‘long int’}
 2679 |             PySys_WriteStderr("%lc", ch);
initconfig.c:2682:38: warning: format ‘%x’ expects argument of type
‘unsigned int’, but argument 2 has type ‘wchar_t’ {aka ‘long int’}
 2682 |             PySys_WriteStderr("\\x%02x", ch);
initconfig.c:2686:38: warning: format ‘%x’ expects argument of type
‘unsigned int’, but argument 2 has type ‘wchar_t’ {aka ‘long int’}
 2686 |             PySys_WriteStderr("\\U%08x", ch);
initconfig.c:2690:38: warning: format ‘%x’ expects argument of type
‘unsigned int’, but argument 2 has type ‘wchar_t’ {aka ‘long int’}
 2690 |             PySys_WriteStderr("\\u%04x", ch);
(cherry picked from commit 640e8e1d5f61d5868453d992da04bf4741327748)

Co-authored-by: Victor Stinner &lt;vstinner@python.org&gt;</content>
</entry>
<entry>
<title>bpo-41525: Make the Python program help ASCII-only (GH-21836)</title>
<updated>2020-09-09T00:46:41Z</updated>
<author>
<name>Miss Islington (bot)</name>
<email>31488909+miss-islington@users.noreply.github.com</email>
</author>
<published>2020-09-09T00:46:41Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=9171dc2827650a1a3c20dee994145e335befa00e'/>
<id>urn:sha1:9171dc2827650a1a3c20dee994145e335befa00e</id>
<content type='text'>
(cherry picked from commit 58de1dd6a8677bd213802c19204b827cb7134695)

Co-authored-by: Serhiy Storchaka &lt;storchaka@gmail.com&gt;</content>
</entry>
<entry>
<title>bpo-22490: Remove __PYVENV_LAUNCHER__ from environment during launch (GH-9516) (GH-19110)</title>
<updated>2020-03-22T18:56:26Z</updated>
<author>
<name>Miss Islington (bot)</name>
<email>31488909+miss-islington@users.noreply.github.com</email>
</author>
<published>2020-03-22T18:56:26Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=c959fa9353b92ce95dd7fe3f25fe65bacbe22338'/>
<id>urn:sha1:c959fa9353b92ce95dd7fe3f25fe65bacbe22338</id>
<content type='text'>
* bpo-22490: Remove "__PYVENV_LAUNCHER__" from the shell environment on macOS

This changeset removes the environment varialbe "__PYVENV_LAUNCHER__"
during interpreter launch as it is only needed to communicate between
the stub executable in framework installs and the actual interpreter.

Leaving the environment variable present may lead to misbehaviour when
launching other scripts.

* Actually commit the changes for issue 22490...

* Correct typo

Co-Authored-By: Nicola Soranzo &lt;nicola.soranzo@gmail.com&gt;

* Run make patchcheck

Co-authored-by: Jason R. Coombs &lt;jaraco@jaraco.com&gt;
Co-authored-by: Nicola Soranzo &lt;nicola.soranzo@gmail.com&gt;
(cherry picked from commit 044cf94f610e831464a69a8e713dad89878824ce)

Co-authored-by: Ronald Oussoren &lt;ronaldoussoren@mac.com&gt;

Co-authored-by: Ronald Oussoren &lt;ronaldoussoren@mac.com&gt;</content>
</entry>
<entry>
<title>[3.8] bpo-39427: Document -X opt options in the CLI --help and the man page (GH-18131) (GH-18133)</title>
<updated>2020-02-23T20:48:27Z</updated>
<author>
<name>Pablo Galindo</name>
<email>Pablogsal@gmail.com</email>
</author>
<published>2020-02-23T20:48:27Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=13951c7f25c628ea2dc0a869ebe18e7bf593fa6d'/>
<id>urn:sha1:13951c7f25c628ea2dc0a869ebe18e7bf593fa6d</id>
<content type='text'>
https://bugs.python.org/issue39427

Automerge-Triggered-By: @pablogsal
(cherry picked from commit 41f0ef6abbd304409c55612a08788cdd59fbc8a3)

Co-authored-by: Pablo Galindo &lt;Pablogsal@gmail.com&gt;</content>
</entry>
<entry>
<title>Add PYTHONUTF8 to commandline usage. (GH-17587)</title>
<updated>2019-12-14T10:38:35Z</updated>
<author>
<name>Miss Islington (bot)</name>
<email>31488909+miss-islington@users.noreply.github.com</email>
</author>
<published>2019-12-14T10:38:35Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=4a5db78c9a46a9d151635bc09c7c891069c6bf52'/>
<id>urn:sha1:4a5db78c9a46a9d151635bc09c7c891069c6bf52</id>
<content type='text'>
Co-Authored-By: Victor Stinner &lt;vstinner@python.org&gt;
(cherry picked from commit 95826c773a9004fc5b3c89de55f800504685ab21)

Co-authored-by: Inada Naoki &lt;songofacandy@gmail.com&gt;</content>
</entry>
<entry>
<title>bpo-38304: PyConfig_InitPythonConfig() cannot fail anymore (GH-16509)</title>
<updated>2019-10-01T10:26:04Z</updated>
<author>
<name>Miss Islington (bot)</name>
<email>31488909+miss-islington@users.noreply.github.com</email>
</author>
<published>2019-10-01T10:26:04Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=d49f096cc41f57155efe71cd089c29b38c218488'/>
<id>urn:sha1:d49f096cc41f57155efe71cd089c29b38c218488</id>
<content type='text'>
PyConfig_InitPythonConfig() and PyConfig_InitIsolatedConfig() no
longer return PyStatus: they cannot fail anymore.
(cherry picked from commit 8462a4936b3a551dc546a6adea04a70b0a07ca67)

Co-authored-by: Victor Stinner &lt;vstinner@redhat.com&gt;</content>
</entry>
<entry>
<title>bpo-38304: Remove PyConfig.struct_size (GH-16500)</title>
<updated>2019-09-30T22:46:42Z</updated>
<author>
<name>Victor Stinner</name>
<email>vstinner@redhat.com</email>
</author>
<published>2019-09-30T22:46:42Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=bdace21b769998396d0ccc8da99a8ca9b507bfdf'/>
<id>urn:sha1:bdace21b769998396d0ccc8da99a8ca9b507bfdf</id>
<content type='text'>
For now, we'll rely on the fact that the config structures aren't covered by the stable ABI.

We may revisit this in the future if we further explore the idea of offering a stable embedding API.</content>
</entry>
</feed>
