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-11-2012, 05:21 PM
Andrew Price
 
Default gfs2_convert: Fix null pointer deref in conv_build_jindex

Spotted by coverity: Dereferencing a null pointer "sdp->md.journal".

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

diff --git a/gfs2/convert/gfs2_convert.c b/gfs2/convert/gfs2_convert.c
index 9b54670..9944d23 100644
--- a/gfs2/convert/gfs2_convert.c
+++ b/gfs2/convert/gfs2_convert.c
@@ -1918,6 +1918,9 @@ static int conv_build_jindex(struct gfs2_sbd *sdp)

sdp->md.journal = malloc(sdp->md.journals *
sizeof(struct gfs2_inode *));
+ if (sdp->md.journal == NULL) {
+ return errno;
+ }
for (j = 0; j < sdp->md.journals; j++) {
char name[256];

--
1.7.6.5
 

Thread Tools




All times are GMT. The time now is 11:03 AM.

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