From: Ross Lagerwall Date: Thu, 7 Aug 2014 19:45:08 +0000 (+0100) Subject: libnfs: Fix segfault if O_TRUNC fails when creating X-Git-Tag: upstream/1.9.6^2~14 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=408cd870b8612dba174aab849239016f66c2d2cd;p=deb_libnfs.git libnfs: Fix segfault if O_TRUNC fails when creating Signed-off-by: Ross Lagerwall --- diff --git a/lib/libnfs.c b/lib/libnfs.c index 5692dc3..87106bb 100644 --- a/lib/libnfs.c +++ b/lib/libnfs.c @@ -2771,7 +2771,7 @@ static void nfs_create_trunc_cb(struct rpc_context *rpc, int status, void *comma { struct nfs_cb_data *data = private_data; struct nfs_context *nfs = data->nfs; - struct nfsfh *nfsfh; + struct nfsfh *nfsfh = data->nfsfh; SETATTR3res *res; assert(rpc->magic == RPC_CONTEXT_MAGIC); @@ -2798,7 +2798,7 @@ static void nfs_create_trunc_cb(struct rpc_context *rpc, int status, void *comma return; } - data->cb(0, nfs, data->nfsfh, data->private_data); + data->cb(0, nfs, nfsfh, data->private_data); free_nfs_cb_data(data); }