summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaghavendra Bhat <raghavendrabhat@gluster.com>2011-04-08 14:46:54 +0000
committerAnand Avati <avati@gluster.com>2011-04-11 05:43:43 -0700
commit67d77aa96dccefe68a44473bf45cf6796e741b7d (patch)
tree45e73316bdb1bdfd0ed335f18be4800e092ccbb8
parent86a091ac0d46ce2b06b79ceafe728ee65fc6ebbf (diff)
buf and statpost should be checked for NULL before accessing it
Signed-off-by: Raghavendra Bhat <raghavendrabhat@gluster.com> Signed-off-by: Anand Avati <avati@gluster.com> BUG: 2701 ([6db2b422f05d0553d0a83af603ae4d176b41cbdf]: crash in quota_readlink_cbk) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2701
-rw-r--r--xlators/features/quota/src/quota.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/xlators/features/quota/src/quota.c b/xlators/features/quota/src/quota.c
index 0cf31b52e8a..1911d63e364 100644
--- a/xlators/features/quota/src/quota.c
+++ b/xlators/features/quota/src/quota.c
@@ -2047,7 +2047,8 @@ quota_stat_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
LOCK (&ctx->lock);
{
- ctx->buf = *buf;
+ if (buf)
+ ctx->buf = *buf;
}
UNLOCK (&ctx->lock);
@@ -2110,7 +2111,8 @@ quota_fstat_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
LOCK (&ctx->lock);
{
- ctx->buf = *buf;
+ if (buf)
+ ctx->buf = *buf;
}
UNLOCK (&ctx->lock);
@@ -2352,7 +2354,8 @@ quota_setattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
LOCK (&ctx->lock);
{
- ctx->buf = *statpost;
+ if (statpost)
+ ctx->buf = *statpost;
}
UNLOCK (&ctx->lock);