From: xie xingguo Date: Mon, 4 Jan 2016 07:09:59 +0000 (+0800) Subject: os: fix potential null pointer access X-Git-Tag: v10.0.3~131^2~5 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=3d0b479bfb909d30703c126f7f90c4dc984875af;p=ceph.git os: fix potential null pointer access Fixes: #14204 Signed-off-by: xie xingguo --- diff --git a/src/os/kstore/KStore.cc b/src/os/kstore/KStore.cc index 039f06981e95..5d05fa15d12b 100644 --- a/src/os/kstore/KStore.cc +++ b/src/os/kstore/KStore.cc @@ -3127,7 +3127,7 @@ int KStore::_truncate(TransContext *txc, RWLock::WLocker l(c->lock); OnodeRef o = c->get_onode(oid, false); - if (!o->exists) { + if (!o || !o->exists) { r = -ENOENT; goto out; }