Skip to content

Commit

Permalink
Bugfix for buffer size increment loop
Browse files Browse the repository at this point in the history
Signed-off-by: Amit Barve <ambarve@microsoft.com>
  • Loading branch information
ambarve committed May 11, 2022
1 parent b861ac9 commit 53c0717
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ea.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ func GetFileEA(handle windows.Handle) ([]ExtendedAttribute, error) {
// convert ntstatus code to windows error
werr := rtlNtStatusToDosError(status)
if werr == syscall.ERROR_INSUFFICIENT_BUFFER || werr == syscall.ERROR_MORE_DATA {
buf = make([]byte, bufLen*2)
bufLen *= 2
buf = make([]byte, bufLen)
} else {
return nil, fmt.Errorf("get file EA failed with: %w", werr)
}
Expand Down

0 comments on commit 53c0717

Please sign in to comment.