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.
master
Klaus Post 5 years ago committed by GitHub
parent d0ae69087c
commit de6c286258
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      pkg/disk/type_windows.go

@ -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

Loading…
Cancel
Save