Barrier: Fix potential locking issue (#17944)
* Barrier: Fix potential locking issue * add changelog
This commit is contained in:
parent
775a1b3001
commit
288b0567b1
|
@ -0,0 +1,3 @@
|
|||
```release-note:bug
|
||||
core: Fix potential deadlock if barrier ciphertext is less than 4 bytes.
|
||||
```
|
|
@ -1069,11 +1069,13 @@ func (b *AESGCMBarrier) Decrypt(_ context.Context, key string, ciphertext []byte
|
|||
}
|
||||
|
||||
if len(ciphertext) == 0 {
|
||||
b.l.RUnlock()
|
||||
return nil, fmt.Errorf("empty ciphertext")
|
||||
}
|
||||
|
||||
// Verify the term
|
||||
if len(ciphertext) < 4 {
|
||||
b.l.RUnlock()
|
||||
return nil, fmt.Errorf("invalid ciphertext term")
|
||||
}
|
||||
term := binary.BigEndian.Uint32(ciphertext[:4])
|
||||
|
|
Loading…
Reference in New Issue