Skip to content

Commit 01872b8

Browse files
committed
[NPFS] Fix dereference of uninitialized variable
- Avoid uninitialized return variables - Fix a parameter check
1 parent 0b18dfe commit 01872b8

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

drivers/filesystems/npfs/fileobsup.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ NpDecodeFileObject(IN PFILE_OBJECT FileObject,
3636
switch (Node->NodeType)
3737
{
3838
case NPFS_NTC_VCB:
39+
*Ccb = NULL;
40+
if (PrimaryContext) *PrimaryContext = Node;
3941
return NPFS_NTC_VCB;
4042

4143
case NPFS_NTC_ROOT_DCB:

drivers/filesystems/npfs/fsctrl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ NpPeek(IN PDEVICE_OBJECT DeviceObject,
363363
return STATUS_PIPE_DISCONNECTED;
364364
}
365365

366-
if ((Type != NPFS_NTC_CCB) &&
366+
if ((Type != NPFS_NTC_CCB) ||
367367
(OutputLength < FIELD_OFFSET(FILE_PIPE_PEEK_BUFFER, Data)))
368368
{
369369
return STATUS_INVALID_PARAMETER;

0 commit comments

Comments
 (0)