diff options
| author | Damien George <damien@micropython.org> | 2025-09-16 13:15:10 +1000 |
|---|---|---|
| committer | Damien George <damien@micropython.org> | 2025-10-01 11:14:39 +1000 |
| commit | 7681c683920055a7b0285b2b40ce94656293d32e (patch) | |
| tree | 4f9bc523858d7800b80dc5f1622cd4a7a6af1505 /extmod/vfs_blockdev.c | |
| parent | 6d65882b05381522ff946ba1f41fd0122edb344f (diff) | |
extmod/vfs_blockdev: Check return type is an integer.
This catches cases where the return type is not a small int, eg it could be
a string, or even a big integer.
Signed-off-by: Damien George <damien@micropython.org>
Diffstat (limited to 'extmod/vfs_blockdev.c')
| -rw-r--r-- | extmod/vfs_blockdev.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/extmod/vfs_blockdev.c b/extmod/vfs_blockdev.c index d43c96b08..5c7d248ac 100644 --- a/extmod/vfs_blockdev.c +++ b/extmod/vfs_blockdev.c @@ -69,7 +69,7 @@ static int mp_vfs_blockdev_call_rw(mp_obj_t *args, size_t block_num, size_t bloc // and negative integer on errors. Check for positive integer // results as some callers (i.e. littlefs) will produce corrupt // results from these. - int i = MP_OBJ_SMALL_INT_VALUE(ret); + int i = mp_obj_get_int(ret); return i > 0 ? (-MP_EINVAL) : i; } } |
