From: Andrew Price <anprice@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [PATCH 02/11] gfs2_edit: Check return value of compute_constants
Date: Fri, 6 Jan 2012 15:19:21 +0000 [thread overview]
Message-ID: <1325863170-32530-2-git-send-email-anprice@redhat.com> (raw)
In-Reply-To: <1325863170-32530-1-git-send-email-anprice@redhat.com>
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);
--
1.7.6.4
next prev parent reply other threads:[~2012-01-06 15:19 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-06 15:19 [Cluster-devel] [PATCH 01/11] gfs2_edit: Remove a useless assignment Andrew Price
2012-01-06 15:19 ` Andrew Price [this message]
2012-01-06 15:19 ` [Cluster-devel] [PATCH 03/11] gfs2_edit: Fix possible uninitialized access Andrew Price
2012-01-06 15:19 ` [Cluster-devel] [PATCH 04/11] gfs2_edit: Fix memory leak in dump_journal() Andrew Price
2012-01-06 15:19 ` [Cluster-devel] [PATCH 05/11] gfs2_edit: Fix null pointer dereference in dump_journal Andrew Price
2012-01-06 15:19 ` [Cluster-devel] [PATCH 06/11] gfs2_edit: Remove unused j_inode from find_journal_block() Andrew Price
2012-01-06 15:19 ` [Cluster-devel] [PATCH 07/11] gfs2_edit: Fix memory leak in find_journal_block Andrew Price
2012-01-06 15:19 ` [Cluster-devel] [PATCH 08/11] gfs2_edit: Check for error value from gfs2_get_bitmap Andrew Price
2012-01-06 15:19 ` [Cluster-devel] [PATCH 09/11] gfs2_edit: Fix resource leaks in display_extended() Andrew Price
2012-01-06 15:19 ` [Cluster-devel] [PATCH 10/11] gfs2_edit: Fix resource leak in print_block_details() Andrew Price
2012-01-06 15:19 ` [Cluster-devel] [PATCH 11/11] gfs2_edit: Fix null pointer derefs in display_block_type() Andrew Price
2012-01-06 15:24 ` Steven Whitehouse
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1325863170-32530-2-git-send-email-anprice@redhat.com \
--to=anprice@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).