FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Cluster Development

 
 
LinkBack Thread Tools
 
Old 01-06-2012, 02:19 PM
Andrew Price
 
Default gfs2_edit: Check return value of compute_constants

Spotted by coverity: Calling function "compute_constants" without
checking return value.

Signed-off-by: Andrew Price <anprice@redhat.com>
---
gfs2/edit/hexedit.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/gfs2/edit/hexedit.c b/gfs2/edit/hexedit.c
index 73fb39f..fcab625 100644
--- a/gfs2/edit/hexedit.c
+++ b/gfs2/edit/hexedit.c
@@ -1276,7 +1276,10 @@ static void read_superblock(int fd)
perror(sbd.device_name);
exit(-1);
}
- compute_constants(&sbd);
+ if(compute_constants(&sbd)) {
+ fprintf(stderr, "Failed to compute constants.
");
+ exit(-1);
+ }
if (sbd.gfs1 || (sbd.sd_sb.sb_header.mh_magic == GFS2_MAGIC &&
sbd.sd_sb.sb_header.mh_type == GFS2_METATYPE_SB))
block = 0x10 * (GFS2_DEFAULT_BSIZE / sbd.bsize);
--
1.7.6.4
 

Thread Tools




All times are GMT. The time now is 07:51 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org