From 35dea20e40958ebbf018354e040570e654eb6bfc Mon Sep 17 00:00:00 2001 From: Raghavendra Bhat Date: Tue, 5 Apr 2011 14:24:59 +0000 Subject: check buf for NULL before accessing it Signed-off-by: Raghavendra Bhat Signed-off-by: Vijay Bellur BUG: 2675 ([glusterfs-3.2.0qa7]: glusterfs client crashed) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2675 --- xlators/features/quota/src/quota.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xlators/features/quota/src/quota.c b/xlators/features/quota/src/quota.c index 0b0f8ce93..6400505ad 100644 --- a/xlators/features/quota/src/quota.c +++ b/xlators/features/quota/src/quota.c @@ -463,7 +463,8 @@ __quota_init_inode_ctx (inode_t *inode, int64_t limit, xlator_t *this, QUOTA_ALLOC_OR_GOTO (ctx, quota_inode_ctx_t, out); ctx->limit = limit; - ctx->buf = *buf; + if (buf) + ctx->buf = *buf; LOCK_INIT(&ctx->lock); -- cgit