Gitweb:
http://git.fedorahosted.org/git/gfs2-utils.git?p=gfs2-utils.git;a=commitd...
Commit: 2e210657077be76fca37f377ef671842d4ebccaa
Parent: 320251b01daf66d9324a32a1db9c00015c67c0e4
Author: Andrew Price <anprice(a)redhat.com>
AuthorDate: Thu Sep 15 11:27:56 2011 +0100
Committer: Andrew Price <anprice(a)redhat.com>
CommitterDate: Thu Sep 15 11:27:56 2011 +0100
gfs2_edit: Fix zeroing the memory for indirect
At two points we currently memset indirect to zero but only with
sizeof(indirect). Since indirect is a pointer this is insufficient. This
patch uses sizeof(struct iinfo) to zero the memory fully.
Signed-off-by: Andrew Price <anprice(a)redhat.com>
---
gfs2/edit/gfs2hex.c | 2 +-
gfs2/edit/hexedit.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/gfs2/edit/gfs2hex.c b/gfs2/edit/gfs2hex.c
index 40959c7..5616122 100644
--- a/gfs2/edit/gfs2hex.c
+++ b/gfs2/edit/gfs2hex.c
@@ -279,7 +279,7 @@ void do_dinode_extended(struct gfs2_dinode *dine, struct
gfs2_buffer_head *lbh)
(sbd.gfs1 && dine->__pad1 == GFS_FILE_DIR);
indirect_blocks = 0;
- memset(indirect, 0, sizeof(indirect));
+ memset(indirect, 0, sizeof(struct iinfo));
if (dine->di_height > 0) {
/* Indirect pointers */
for (x = sizeof(struct gfs2_dinode); x < sbd.bsize;
diff --git a/gfs2/edit/hexedit.c b/gfs2/edit/hexedit.c
index 5864e2d..952723f 100644
--- a/gfs2/edit/hexedit.c
+++ b/gfs2/edit/hexedit.c
@@ -1838,7 +1838,7 @@ int display(int identify_only)
lines_per_row[dmode] = 1;
if (gfs2_struct_type == GFS2_METATYPE_SB || blk == 0x10 * (4096 / sbd.bsize)) {
gfs2_sb_in(&sbd.sd_sb, bh); /* parse it out into the sb structure */
- memset(indirect, 0, sizeof(indirect));
+ memset(indirect, 0, sizeof(struct iinfo));
indirect->ii[0].block = sbd.sd_sb.sb_master_dir.no_addr;
indirect->ii[0].is_dir = TRUE;
indirect->ii[0].dirents = 2;