All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] btrfs-progs: btrfs-image.c: Added NULL pointer check.
@ 2012-07-27 10:34 Nageswara R Sastry
  2012-07-27 11:09 ` Stefan Behrens
  0 siblings, 1 reply; 3+ messages in thread
From: Nageswara R Sastry @ 2012-07-27 10:34 UTC (permalink / raw)
  To: linux-btrfs; +Cc: chandanrmail

Check for the return value of 'open_ctree()' before dereferencing it.

Signed-off-by: Nageswara R Sastry <nasastry@in.ibm.com>
---
 btrfs-image.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/btrfs-image.c b/btrfs-image.c
index f2bbcc8..2a33a55 100644
--- a/btrfs-image.c
+++ b/btrfs-image.c
@@ -491,6 +491,7 @@ static int create_metadump(const char *input, FILE *out, int num_threads,
 	int ret;
 
 	root = open_ctree(input, 0, 0);
+	BUG_ON(!root);
 	BUG_ON(root->nodesize != root->leafsize);
 
 	ret = metadump_init(&metadump, root, out, num_threads,
-- 
1.7.11.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-07-27 11:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-27 10:34 [PATCH] btrfs-progs: btrfs-image.c: Added NULL pointer check Nageswara R Sastry
2012-07-27 11:09 ` Stefan Behrens
2012-07-27 11:40   ` Stefan Behrens

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.