From 4febada51fca5953b84b71b71c9aa0a430c4ee3d Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Tue, 15 May 2007 06:51:18 +0000 Subject: r22882: It seems entirly reasonable to follow metze's suggestion and check for a valid file handle first. Andrew Bartlett (This used to be commit 3947db3dcbfe97e9ccb9b9bd2b3a69cf7683af9f) --- source4/ntvfs/ipc/vfs_ipc.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'source4') diff --git a/source4/ntvfs/ipc/vfs_ipc.c b/source4/ntvfs/ipc/vfs_ipc.c index 20b70415aa..70dd3e3561 100644 --- a/source4/ntvfs/ipc/vfs_ipc.c +++ b/source4/ntvfs/ipc/vfs_ipc.c @@ -610,14 +610,13 @@ static NTSTATUS ipc_qfileinfo(struct ntvfs_module_context *ntvfs, struct ntvfs_request *req, union smb_fileinfo *info) { struct ipc_private *private = ntvfs->private_data; + struct pipe_state *p = pipe_state_find(private, info->generic.in.file.ntvfs); + if (!p) { + return NT_STATUS_INVALID_HANDLE; + } switch (info->generic.level) { case RAW_FILEINFO_GENERIC: { - struct pipe_state *p; - p = pipe_state_find(private, info->generic.in.file.ntvfs); - if (!p) { - return NT_STATUS_INVALID_HANDLE; - } ZERO_STRUCT(info->generic.out); info->generic.out.attrib = FILE_ATTRIBUTE_NORMAL; info->generic.out.fname.s = strrchr(p->pipe_name, '\\'); -- cgit