python: signed overflow in _pickle

git log

commit 4ae8ece5cd4c5853b625381db13429f25512108d
Author: Gregory P. Smith <[email protected]>
Date:   Wed Sep 12 17:58:40 2018 -0700

error log

./python pk.py poc

cat ./pk.py

import pickle
import sys
filename = sys.argv[1]
with open(filename, 'rb') as f:
    aa = pickle.load(f)
    print(aa)

memory exhaustion and python hang

report and patch

https://bugs.python.org/issue34656

https://github.com/python/cpython/pull/9261/commits/59c974e3589c27b9e10bede5bf1a3f75b41087a7