aboutsummaryrefslogtreecommitdiff
path: root/extmod/vfs_fat.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2017-08-21 20:47:22 +1000
committerDamien George <damien.p.george@gmail.com>2017-08-21 20:47:22 +1000
commit4c736ea8fc046dc564f9167967a5dd92f07ed002 (patch)
tree179001d76c6574f64b04722522ea7808a0d3e176 /extmod/vfs_fat.c
parentb16a755a0b6f471fff8dc1d29794b9c4105fc093 (diff)
extmod,unix: For uos.stat interpret st_size member as an unsigned int.
This prevents large files (eg larger than 2gb on a 32-bit arch) from showing up as having a negative size. Fixes issue #3227.
Diffstat (limited to 'extmod/vfs_fat.c')
-rw-r--r--extmod/vfs_fat.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/extmod/vfs_fat.c b/extmod/vfs_fat.c
index 0ec3fe6d2..b27054111 100644
--- a/extmod/vfs_fat.c
+++ b/extmod/vfs_fat.c
@@ -243,7 +243,7 @@ STATIC mp_obj_t fat_vfs_stat(mp_obj_t vfs_in, mp_obj_t path_in) {
t->items[3] = MP_OBJ_NEW_SMALL_INT(0); // st_nlink
t->items[4] = MP_OBJ_NEW_SMALL_INT(0); // st_uid
t->items[5] = MP_OBJ_NEW_SMALL_INT(0); // st_gid
- t->items[6] = MP_OBJ_NEW_SMALL_INT(fno.fsize); // st_size
+ t->items[6] = mp_obj_new_int_from_uint(fno.fsize); // st_size
t->items[7] = MP_OBJ_NEW_SMALL_INT(seconds); // st_atime
t->items[8] = MP_OBJ_NEW_SMALL_INT(seconds); // st_mtime
t->items[9] = MP_OBJ_NEW_SMALL_INT(seconds); // st_ctime