mirror of
https://github.com/micropython/micropython.git
synced 2026-01-07 12:40:15 +01:00
extmod/moductypes: Validate that uctypes.struct addr argument is an int.
Fixes issue #12660. Signed-off-by: Damien George <damien@micropython.org>
This commit is contained in:
@@ -8,6 +8,12 @@ except ImportError:
|
||||
|
||||
data = bytearray(b"01234567")
|
||||
|
||||
# first argument isn't an integer
|
||||
try:
|
||||
uctypes.struct(data, {})
|
||||
except TypeError:
|
||||
print("TypeError")
|
||||
|
||||
# del subscr not supported
|
||||
S = uctypes.struct(uctypes.addressof(data), {})
|
||||
try:
|
||||
|
||||
@@ -3,3 +3,4 @@ TypeError
|
||||
TypeError
|
||||
TypeError
|
||||
TypeError
|
||||
TypeError
|
||||
|
||||
Reference in New Issue
Block a user