Windows: AFSParseMountPointTarget buffer overrun

When parsing the AFS mount point string do not overrun
the buffer if the colon cell/volume separator is not
found.

Change-Id: Id7275cc8815223730f7c39bd11a6f495beb117c4
Reviewed-on: http://gerrit.openafs.org/6507
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Peter Scott <pscott@kerneldrivers.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
This commit is contained in:
Jeffrey Altman 2012-01-04 01:10:37 -05:00 committed by Jeffrey Altman
parent ba4f5afc9c
commit 6185532db5

View File

@ -115,7 +115,8 @@ AFSParseMountPointTarget( IN UNICODE_STRING *Target,
// If a colon is not found, it means there is no cell // If a colon is not found, it means there is no cell
if ( Cell->Buffer[ Cell->Length / sizeof( WCHAR)] == L':') if ( Cell->Length < Target->Length - sizeof( WCHAR) &&
Cell->Buffer[ Cell->Length / sizeof( WCHAR)] == L':')
{ {
Cell->MaximumLength = Cell->Length; Cell->MaximumLength = Cell->Length;