From: Sage Weil Date: Sun, 23 Feb 2014 18:18:02 +0000 (-0800) Subject: client: fix possible null dereference in create X-Git-Tag: v0.78~120^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F1302%2Fhead;p=ceph.git client: fix possible null dereference in create There are two paths that jump to the out label for which 'in' can be NULL and outp can be non-NULL. For those cases we want to fill in the caller's pointer value (they asked for it) but we clearly cannot take a reference. Backport: emperor, dumpling Signed-off-by: Sage Weil --- diff --git a/src/client/Client.cc b/src/client/Client.cc index d4a91a088c8a..699d369a5416 100644 --- a/src/client/Client.cc +++ b/src/client/Client.cc @@ -8138,7 +8138,8 @@ out: // passing an Inode in outp requires an additional ref if (outp) { - _ll_get(in); + if (in) + _ll_get(in); *outp = in; }