Jonathan Turner 7 lat temu
rodzic
commit
41d0e29fa7
2 zmienionych plików z 6 dodań i 2 usunięć
  1. 3 2
      mstypes/claims.go
  2. 3 0
      pac/device_info.go

+ 3 - 2
mstypes/claims.go

@@ -17,7 +17,7 @@ const (
 	CompressionFormatXPressHuff uint16 = 4
 )
 
-// ClaimsSourceType
+// ClaimsSourceTypeAD
 const ClaimsSourceTypeAD uint16 = 1
 
 // Claim Type assigned numbers
@@ -52,7 +52,7 @@ type ClaimsSetMetadata struct {
 	ReservedField             []byte
 }
 
-// ClaimSet implements https://msdn.microsoft.com/en-us/library/hh554122.aspx
+// ClaimsSet implements https://msdn.microsoft.com/en-us/library/hh554122.aspx
 type ClaimsSet struct {
 	ClaimsArrayCount  uint32
 	ClaimsArrays      []ClaimsArray
@@ -237,6 +237,7 @@ func ReadClaimsArray(b *[]byte, p *int, e *binary.ByteOrder) (c ClaimsArray, err
 	return
 }
 
+// ReadClaimEntriesUnionHeaders reads the union headers from the byte stream.
 func ReadClaimEntriesUnionHeaders(b *[]byte, p *int, e *binary.ByteOrder) (uint16, uint32, error) {
 	*p += 4
 	// This is an NDR union: http://pubs.opengroup.org/onlinepubs/9629399/chap14.htm#tagfcjh_39

+ 3 - 0
pac/device_info.go

@@ -50,6 +50,9 @@ func (k *DeviceInfo) Unmarshal(b []byte) error {
 	var ah ndr.ConformantArrayHeader
 	if k.SIDCount > 0 {
 		ah, err = ndr.ReadUniDimensionalConformantArrayHeader(&b, &p, e)
+		if err != nil {
+			return fmt.Errorf("could not read ExtraSIDs array header: %v", err)
+		}
 		if ah.MaxCount != int(k.SIDCount) {
 			return fmt.Errorf("error with size of ExtraSIDs list. expected: %d, Actual: %d", k.SIDCount, ah.MaxCount)
 		}