* [Cluster-devel] [PATCH] Fix clang --analyze warning.
@ 2012-12-17 14:43 Sitsofe Wheeler
2012-12-18 10:53 ` Andrew Price
0 siblings, 1 reply; 2+ messages in thread
From: Sitsofe Wheeler @ 2012-12-17 14:43 UTC (permalink / raw)
To: cluster-devel.redhat.com
- Return before a possible NULL pointer dereference.
---
gfs2/libgfs2/fs_bits.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/gfs2/libgfs2/fs_bits.c b/gfs2/libgfs2/fs_bits.c
index 94a612b..e4b5505 100644
--- a/gfs2/libgfs2/fs_bits.c
+++ b/gfs2/libgfs2/fs_bits.c
@@ -149,6 +149,8 @@ int gfs2_set_bitmap(struct gfs2_sbd *sdp, uint64_t blkno, int state)
break;
}
+ if (bits == NULL)
+ return -1;
byte = (unsigned char *)(rgd->bh[buf]->b_data + bits->bi_offset) +
(rgrp_block/GFS2_NBBY - bits->bi_start);
bit = (rgrp_block % GFS2_NBBY) * GFS2_BIT_SIZE;
--
1.7.2.5
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [Cluster-devel] [PATCH] Fix clang --analyze warning.
2012-12-17 14:43 [Cluster-devel] [PATCH] Fix clang --analyze warning Sitsofe Wheeler
@ 2012-12-18 10:53 ` Andrew Price
0 siblings, 0 replies; 2+ messages in thread
From: Andrew Price @ 2012-12-18 10:53 UTC (permalink / raw)
To: cluster-devel.redhat.com
Hi Sits
On 17/12/12 14:43, Sitsofe Wheeler wrote:
> - Return before a possible NULL pointer dereference.
This is now in gfs2-utils.git master.
Thanks,
Andy
> ---
> gfs2/libgfs2/fs_bits.c | 2 ++
> 1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/gfs2/libgfs2/fs_bits.c b/gfs2/libgfs2/fs_bits.c
> index 94a612b..e4b5505 100644
> --- a/gfs2/libgfs2/fs_bits.c
> +++ b/gfs2/libgfs2/fs_bits.c
> @@ -149,6 +149,8 @@ int gfs2_set_bitmap(struct gfs2_sbd *sdp, uint64_t blkno, int state)
> break;
> }
>
> + if (bits == NULL)
> + return -1;
> byte = (unsigned char *)(rgd->bh[buf]->b_data + bits->bi_offset) +
> (rgrp_block/GFS2_NBBY - bits->bi_start);
> bit = (rgrp_block % GFS2_NBBY) * GFS2_BIT_SIZE;
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-12-18 10:53 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-17 14:43 [Cluster-devel] [PATCH] Fix clang --analyze warning Sitsofe Wheeler
2012-12-18 10:53 ` Andrew Price
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).