mirror of
https://github.com/reactos/reactos
synced 2025-10-06 00:12:51 +02:00
[NPFS] Fix dereference of uninitialized variable
- Avoid uninitialized return variables - Fix a parameter check
This commit is contained in:
@@ -36,6 +36,8 @@ NpDecodeFileObject(IN PFILE_OBJECT FileObject,
|
||||
switch (Node->NodeType)
|
||||
{
|
||||
case NPFS_NTC_VCB:
|
||||
*Ccb = NULL;
|
||||
if (PrimaryContext) *PrimaryContext = Node;
|
||||
return NPFS_NTC_VCB;
|
||||
|
||||
case NPFS_NTC_ROOT_DCB:
|
||||
|
@@ -363,7 +363,7 @@ NpPeek(IN PDEVICE_OBJECT DeviceObject,
|
||||
return STATUS_PIPE_DISCONNECTED;
|
||||
}
|
||||
|
||||
if ((Type != NPFS_NTC_CCB) &&
|
||||
if ((Type != NPFS_NTC_CCB) ||
|
||||
(OutputLength < FIELD_OFFSET(FILE_PIPE_PEEK_BUFFER, Data)))
|
||||
{
|
||||
return STATUS_INVALID_PARAMETER;
|
||||
|
Reference in New Issue
Block a user