mirror of
https://github.com/micropython/micropython.git
synced 2026-01-08 05:00:26 +01:00
py/objslice: Validate that the argument to indices() is an integer.
Otherwise passing in a non-integer can lead to an invalid memory access. Thanks to Junwha Hong and Wonil Jang @S2Lab, UNIST for finding the issue. Fixes issue #13007. Signed-off-by: Damien George <damien@micropython.org>
This commit is contained in:
@@ -25,3 +25,8 @@ print(A()[2:7:2].indices(5))
|
||||
print(A()[2:7:-2].indices(5))
|
||||
print(A()[7:2:2].indices(5))
|
||||
print(A()[7:2:-2].indices(5))
|
||||
|
||||
try:
|
||||
print(A()[::].indices(None))
|
||||
except TypeError:
|
||||
print("TypeError")
|
||||
|
||||
Reference in New Issue
Block a user