Skip to content

Commit 47eaacf

Browse files
vstinnerskirpichev
andauthored
Update Python/marshal.c
Co-authored-by: Sergey B Kirpichev <[email protected]>
1 parent 9d95c35 commit 47eaacf

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Python/marshal.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,8 @@ _r_digits##bitsize(const uint ## bitsize ## _t *digits, Py_ssize_t n, \
257257
Py_ssize_t l = (n - 1)*marshal_ratio; \
258258
uint ## bitsize ## _t d = digits[n - 1]; \
259259
\
260+
assert(marshal_ratio > 0); \
261+
assert(n >= 1); \
260262
assert(d != 0); /* a PyLong is always normalized */ \
261263
do { \
262264
d >>= PyLong_MARSHAL_SHIFT; \

0 commit comments

Comments
 (0)