[PATCH 02/11] xfsprogs: fix integer overflow in xlog_find_verify_cycle
Vivek Trivedi
t.vivek at samsung.com
Wed Dec 2 05:19:18 CST 2015
Fix unintentional integer overflow in xlog_find_verify_cycle.
Reported by coverity.
Signed-off-by: Vivek Trivedi <t.vivek at samsung.com>
---
libxlog/xfs_log_recover.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libxlog/xfs_log_recover.c b/libxlog/xfs_log_recover.c
index ef7cf68..73f4d36 100644
--- a/libxlog/xfs_log_recover.c
+++ b/libxlog/xfs_log_recover.c
@@ -254,7 +254,7 @@ xlog_find_verify_cycle(
* try a smaller size. We need to be able to read at least
* a log sector, or we're out of luck.
*/
- bufblks = 1 << ffs(nbblks);
+ bufblks = (xfs_daddr_t)1 << ffs(nbblks);
while (bufblks > log->l_logBBsize)
bufblks >>= 1;
while (!(bp = xlog_get_bp(log, bufblks))) {
--
1.7.9.5
More information about the xfs
mailing list