From de6c2862582a7ae0e35aa7f2f0342acff37c0982 Mon Sep 17 00:00:00 2001 From: Klaus Post Date: Tue, 26 May 2020 12:35:40 -0700 Subject: [PATCH] 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. --- pkg/disk/type_windows.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/disk/type_windows.go b/pkg/disk/type_windows.go index f303090d3..6ea3e1502 100644 --- a/pkg/disk/type_windows.go +++ b/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