fengye110 / dokan

Automatically exported from code.google.com/p/dokan
0 stars 0 forks source link

Call to GetVolumeInformation() passes incorrect buffer size for VolumeName and FSName #89

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
According to MSDN the GetVolumeInformation() expects the 'nVolumeNameSize'
and 'nFileSystemNameSize' parameters to be size in TCHARs. The Dokan
however passes size in bytes. 

dokan/volume.c:
status = DokanOperations->GetVolumeInformation(
  volumeName,             // VolumeNameBuffer
  sizeof(volumeName), <== // VolumeNameSize
  &volumeSerial,          // VolumeSerialNumber
  &maxComLength,          // MaximumComponentLength
  &fsFlags,               // FileSystemFlags
  fsName,                 // FileSystemNameBuffer
  sizeof(fsName),     <== // FileSystemNameSize
  FileInfo
);

As a result, attempt to return more than MAX_PATH chars causes memory
corruption.

Original issue reported on code.google.com by iry...@gmail.com on 1 May 2009 at 4:52

GoogleCodeExporter commented 9 years ago
Thank you for your report.
I submitted the fix: http://code.google.com/p/dokan/source/detail?r=46

Original comment by asa...@gmail.com on 19 Oct 2009 at 3:09