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-18-2012, 03:39 PM
Andrew Price
 
Default fsck.gfs2: Fix null pointer deref in check_system_dir()

Spotted by coverity: Dereferencing null variable "sysinode".

Signed-off-by: Andrew Price <anprice@redhat.com>
---
gfs2/fsck/pass2.c | 11 ++++++++---
1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/gfs2/fsck/pass2.c b/gfs2/fsck/pass2.c
index c530695..78c9f47 100644
--- a/gfs2/fsck/pass2.c
+++ b/gfs2/fsck/pass2.c
@@ -623,10 +623,15 @@ static int check_system_dir(struct gfs2_inode *sysinode, const char *dirname,

log_info( _("Checking system directory inode '%s'
"), dirname);

- if (sysinode) {
- iblock = sysinode->i_di.di_num.no_addr;
- ds.q = block_type(iblock);
+ if (!sysinode) {
+ log_err( _("Failed to check '%s': sysinode is null
"), dirname);
+ stack;
+ return -1;
}
+
+ iblock = sysinode->i_di.di_num.no_addr;
+ ds.q = block_type(iblock);
+
pass2_fxns.private = (void *) &ds;
if (ds.q == gfs2_bad_block) {
/* First check that the directory's metatree is valid */
--
1.7.7.5
 

Thread Tools




All times are GMT. The time now is 12:29 PM.

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