This is an automated email from the git hooks/post-receive script.
andyp pushed a commit to branch master
in repository gfs2-utils.
commit 60b5256092bc53adaab5a9516e05ecd00ee5f11b
Author: Andrew Price <anprice(a)redhat.com>
Date: Wed Mar 7 11:32:36 2018 +0000
gfs2_edit: Avoid a potential int overflow in dump_journal
Spotted by coverity: "Potentially overflowing expression
(rgd->bits->bi_start + rgd->bits->bi_len) * 4U with type unsigned int
(32 bits, unsigned) is evaluated using 32-bit arithmetic, and then used
in a context that expects an expression of type uint64_t (64 bits,
unsigned)"
Signed-off-by: Andrew Price <anprice(a)redhat.com>
---
gfs2/edit/journal.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gfs2/edit/journal.c b/gfs2/edit/journal.c
index 12a9c25..559bd4e 100644
--- a/gfs2/edit/journal.c
+++ b/gfs2/edit/journal.c
@@ -530,7 +530,7 @@ void dump_journal(const char *journal, int tblk)
rgd->ri.ri_length);
o = tblk - rgd->ri.ri_data0;
if (o >= (rgd->bits->bi_start +
- rgd->bits->bi_len) * GFS2_NBBY)
+ rgd->bits->bi_len) * (uint64_t)GFS2_NBBY)
o += (sizeof(struct gfs2_rgrp) -
sizeof(struct gfs2_meta_header))
* GFS2_NBBY;
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
Show replies by date