diff options
author | Gedare Bloom <gedare@rtems.org> | 2013-09-05 12:58:34 -0400 |
---|---|---|
committer | Gedare Bloom <gedare@rtems.org> | 2013-09-05 12:58:34 -0400 |
commit | 551468c2db505562ea06e0f8e576df86e178a68f (patch) | |
tree | e39e19e1221dba56823e96ce3e9c202b0caeefe7 /cpukit/libfs | |
parent | shell: Out-of-bounds access (diff) | |
download | rtems-551468c2db505562ea06e0f8e576df86e178a68f.tar.bz2 |
dosfs: Unintentional integer overflow
Explicitly promote 32-bit integer to 64-bits for multiplication.
Diffstat (limited to 'cpukit/libfs')
-rw-r--r-- | cpukit/libfs/src/dosfs/msdos_format.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/cpukit/libfs/src/dosfs/msdos_format.c b/cpukit/libfs/src/dosfs/msdos_format.c index a939df5eeb..154282fbca 100644 --- a/cpukit/libfs/src/dosfs/msdos_format.c +++ b/cpukit/libfs/src/dosfs/msdos_format.c @@ -515,7 +515,7 @@ static int msdos_format_determine_fmt_params ret_val = rtems_disk_fd_get_block_count(fd, &fmt_params->totl_sector_cnt); } if (ret_val == 0) { - total_size = fmt_params->bytes_per_sector * fmt_params->totl_sector_cnt; + total_size = (uint64_t)fmt_params->bytes_per_sector * fmt_params->totl_sector_cnt; msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_DETAIL, "bytes per sector: %" PRIu32 "\ntotal sectors: %" PRIu32 "\ntotal size: %" PRIu64 "\n", fmt_params->bytes_per_sector, fmt_params->totl_sector_cnt, total_size); |