Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=d8b... Commit: d8bb8e2a981287ea7bc5cf7a73753b6e809edb72 Parent: 98b8634553004ba514febfd19b680d509900a35f Author: Andrew Price anprice@redhat.com AuthorDate: Thu Jan 5 16:19:30 2012 +0000 Committer: Andrew Price anprice@redhat.com CommitterDate: Thu Jan 5 16:19:30 2012 +0000
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.\n"); + 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);
cluster-commits@lists.fedorahosted.org