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:24 PM
Steven Whitehouse
 
Default gfs2_edit: Fix null pointer derefs in display_block_type()

Hi,

Those all look good to me. ACK,

Steve.

On Fri, 2012-01-06 at 15:19 +0000, Andrew Price wrote:
> Spotted by coverity: Dereferencing null variable "rgd".
>
> Signed-off-by: Andrew Price <anprice@redhat.com>
> ---
> gfs2/edit/hexedit.c | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/gfs2/edit/hexedit.c b/gfs2/edit/hexedit.c
> index 02a4091..69d499e 100644
> --- a/gfs2/edit/hexedit.c
> +++ b/gfs2/edit/hexedit.c
> @@ -713,7 +713,7 @@ int display_block_type(int from_restore)
> if ((be32_to_cpu(mh->mh_type) == GFS2_METATYPE_RG)) {
> int ptroffset = edit_row[dmode] * 16 + edit_col[dmode];
>
> - if (ptroffset >= struct_len || pgnum) {
> + if (rgd && (ptroffset >= struct_len || pgnum)) {
> int blknum, b, btype;
>
> blknum = pgnum * screen_chunk_size;
> @@ -731,7 +731,7 @@ int display_block_type(int from_restore)
> } else if ((be32_to_cpu(mh->mh_type) == GFS2_METATYPE_RB)) {
> int ptroffset = edit_row[dmode] * 16 + edit_col[dmode];
>
> - if (ptroffset >= struct_len || pgnum) {
> + if (rgd && (ptroffset >= struct_len || pgnum)) {
> int blknum, b, btype, rb_number;
>
> rb_number = block - rgd->ri.ri_addr;
 

Thread Tools




All times are GMT. The time now is 02:57 PM.

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