Windows: fail if pSrcParentObject cannot be resolved

In AFSSetFileLinkInfo and AFSSetRenameInfo return STATUS_INVALID_PARAMETER
if pSrcParentObject cannot be determined.  Otherwise, a NULL pointer
dereference will occur.

Change-Id: I0e265433aa85066005e90b3584f8e865c5be79c8
Reviewed-on: http://gerrit.openafs.org/9807
Reviewed-by: Peter Scott <pscott@kerneldrivers.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
This commit is contained in:
Jeffrey Altman 2013-04-24 23:33:13 -04:00
parent 0653c81c2a
commit 4512b47be8

View File

@ -2300,6 +2300,18 @@ AFSSetFileLinkInfo( IN PIRP Irp)
&pSrcFcb->ObjectInformation->ParentFileId);
}
if( pSrcParentObject == NULL)
{
AFSDbgTrace(( AFS_SUBSYSTEM_FILE_PROCESSING,
AFS_TRACE_LEVEL_ERROR,
"AFSSetFileLinkInfo Unable to resolve SrcParentObject (INVALID_PARAMETER)\n"));
ASSERT( FALSE);
try_return( ntStatus = STATUS_INVALID_PARAMETER);
}
pFileLinkInfo = (PFILE_LINK_INFORMATION)Irp->AssociatedIrp.SystemBuffer;
//
@ -2723,6 +2735,18 @@ AFSSetRenameInfo( IN PIRP Irp)
&pSrcFcb->ObjectInformation->ParentFileId);
}
if( pSrcParentObject == NULL)
{
AFSDbgTrace(( AFS_SUBSYSTEM_FILE_PROCESSING,
AFS_TRACE_LEVEL_ERROR,
"AFSSetRenameInfo Unable to resolve SrcParentObject (INVALID_PARAMETER)\n"));
ASSERT( FALSE);
try_return( ntStatus = STATUS_INVALID_PARAMETER);
}
//
// Perform some basic checks to ensure FS integrity
//