mirror of
https://github.com/winfsp/winfsp.git
synced 2025-04-23 08:53:01 -05:00
sys: FspVolumeCreate: check VolumeParams->Prefix for proper syntax
This commit is contained in:
parent
2e5af0c6ef
commit
1876aff99c
@ -115,8 +115,21 @@ NTSTATUS FspVolumeCreate(
|
|||||||
for (; 0 < PrefixLength && L'\\' == VolumeParams.Prefix[PrefixLength - 1]; PrefixLength--)
|
for (; 0 < PrefixLength && L'\\' == VolumeParams.Prefix[PrefixLength - 1]; PrefixLength--)
|
||||||
;
|
;
|
||||||
VolumeParams.Prefix[PrefixLength] = L'\0';
|
VolumeParams.Prefix[PrefixLength] = L'\0';
|
||||||
|
|
||||||
|
/* volume prefix cannot be the empty string */
|
||||||
if (0 == PrefixLength)
|
if (0 == PrefixLength)
|
||||||
return STATUS_INVALID_PARAMETER;
|
return STATUS_INVALID_PARAMETER;
|
||||||
|
|
||||||
|
/* volume prefix must start with exactly one backslash */
|
||||||
|
if (L'\\' != VolumeParams.Prefix[0] || L'\\' == VolumeParams.Prefix[1])
|
||||||
|
return STATUS_INVALID_PARAMETER;
|
||||||
|
|
||||||
|
/* volume prefix must have at least one other backslash */
|
||||||
|
USHORT I;
|
||||||
|
for (I = 1; L'\0' != VolumeParams.Prefix[I] && L'\\' != VolumeParams.Prefix[I]; I++)
|
||||||
|
;
|
||||||
|
if (I == PrefixLength)
|
||||||
|
return STATUS_INVALID_PARAMETER;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* create volume guid */
|
/* create volume guid */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user