File tree 2 files changed +11
-0
lines changed
2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -358,6 +358,10 @@ Set implementation-specific option. The following options are available:
358
358
-X frozen_modules=[on|off]: whether or not frozen modules should be used.
359
359
The default is "on" (or "off" if you are running a local build).
360
360
361
+ -X int_max_str_digits=number: limit the size of int<->str conversions.
362
+ This helps avoid denial of service attacks when parsing untrusted data.
363
+ The default is sys.int_info.default_max_str_digits. 0 disables.
364
+
361
365
.TP
362
366
.B \- x
363
367
Skip the first line of the source. This is intended for a DOS
@@ -531,6 +535,11 @@ values.
531
535
532
536
The integer must be a decimal number in the range [0,4294967295]. Specifying
533
537
the value 0 will disable hash randomization.
538
+ .IP PYTHONINTMAXSTRDIGITS
539
+ Limit the maximum digit characters in an int value
540
+ when converting from a string and when converting an int back to a str.
541
+ A value of 0 disables the limit. Conversions to or from bases 2, 4, 8,
542
+ 16, and 32 are never limited.
534
543
.IP PYTHONMALLOC
535
544
Set the Python memory allocators and/or install debug hooks. The available
536
545
memory allocators are
Original file line number Diff line number Diff line change @@ -180,6 +180,8 @@ static const char usage_envvars[] =
180
180
"PYTHONDEBUG : enable parser debug mode (-d)\n"
181
181
"PYTHONDONTWRITEBYTECODE : don't write .pyc files (-B)\n"
182
182
"PYTHONINSPECT : inspect interactively after running script (-i)\n"
183
+ "PYTHONINTMAXSTRDIGITS : limit max digit characters in an int value\n"
184
+ " (-X int_max_str_digits=number)\n"
183
185
"PYTHONNOUSERSITE : disable user site directory (-s)\n"
184
186
"PYTHONOPTIMIZE : enable level 1 optimizations (-O)\n"
185
187
"PYTHONUNBUFFERED : disable stdout/stderr buffering (-u)\n"
You can’t perform that action at this time.
0 commit comments