Skip to content

Commit

Permalink
Fix for GoBytes assumption on incoming slice length
Browse files Browse the repository at this point in the history
  • Loading branch information
lkarlslund committed Mar 20, 2024
1 parent 7774681 commit f1573f2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/integrations/activedirectory/collect/ldap_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -826,9 +826,9 @@ func (ldap WLDAP) ParsePageControl(lc **LDAPControl) (*LDAPBerval, uint32, error
}

func GoBytes(ptr *uint8, length int) []byte {
data := (*[1000000]byte)(unsafe.Pointer(ptr))
result := make([]byte, length)
copy(result, data[:length])
unsafeSlice := unsafe.Slice(ptr, length)
copy(result, unsafeSlice)
return result
}

Expand Down

0 comments on commit f1573f2

Please sign in to comment.