Allocate more buffer (#9683)

The documentation states that `nVolumeNameSize` and `nFileSystemNameSize` are:

> The length of a volume name buffer, in TCHARs. The maximum buffer size is MAX_PATH+1.

It seems like we allocated too little for them before, so expand it to 260 wchars.
This commit is contained in:
Klaus Post 2020-05-26 12:35:40 -07:00 committed by GitHub
parent d0ae69087c
commit de6c286258
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -34,7 +34,7 @@ func getFSType(path string) string {
volumeNameSize, nFileSystemNameSize := uint32(260), uint32(260)
var lpVolumeSerialNumber uint32
var lpFileSystemFlags, lpMaximumComponentLength uint32
var lpFileSystemNameBuffer, volumeName [130]uint16
var lpFileSystemNameBuffer, volumeName [260]uint16
var ps = syscall.StringToUTF16Ptr(filepath.VolumeName(path))
// Extract values safely