-
-
Notifications
You must be signed in to change notification settings - Fork 34.3k
Open
Labels
stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or errortype-securityA security issueA security issue
Description
Bug report
Bug description:
Found by OSS Fuzz in #461069020.
The below reproducer:
import configparser
import time
for N in (10000, 20000, 30000, 40000):
cfg = (
"[section]" +
"\n" + "x" + " " * N + "y" + "\n"
)
parser = configparser.RawConfigParser()
s = time.perf_counter()
try: parser.read_string(cfg)
except: pass
t = time.perf_counter() - s
print(f"{N} {t}")reveals the quadratic behaviour:
10000 0.5478692570177373
20000 2.175520057004178
30000 4.97204191898345
40000 8.673784376995172
CPython versions tested on:
CPython main branch
Operating systems tested on:
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or errortype-securityA security issueA security issue