diff options
-rw-r--r-- | block.c | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -2341,6 +2341,7 @@ int64_t bdrv_getlength(BlockDriverState *bs) { int64_t ret = bdrv_nb_sectors(bs); + ret = ret > INT64_MAX / BDRV_SECTOR_SIZE ? -EFBIG : ret; return ret < 0 ? ret : ret * BDRV_SECTOR_SIZE; } |