Skip to content

Commit ad2e068

Browse files
Potential fix for code scanning alert no. 52: Incorrect conversion between integer types
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
1 parent 0bd50c0 commit ad2e068

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

providers/directory/search.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -573,6 +573,9 @@ func sidToBytes(sid string) ([]byte, error) {
573573
if authIdErr != nil {
574574
return nil, fmt.Errorf("invalid uint value %v at position: %v", parts[1], 1)
575575
}
576+
if authId > 255 {
577+
return nil, fmt.Errorf("IdentifierAuthority value %v out of byte range (0-255) at position: %v", parts[1], 1)
578+
}
576579
result = append(result, byte(authId))
577580
for i, part := range parts[2:] {
578581
val, valErr := strconv.ParseUint(part, 10, 32)

0 commit comments

Comments
 (0)