mirror of
https://github.com/lukaszraczylo/traefikoidc.git
synced 2026-10-17 04:37:48 +00:00
Size computation for allocation may overflow (#99)
* Size computation for allocation may overflow Performing calculations involving the size of potentially large strings or slices can result in an overflow (for signed integer types) or a wraparound (for unsigned types). An overflow causes the result of the calculation to become negative, while a wraparound results in a small (positive) number.
This commit is contained in:
+5
@@ -263,6 +263,7 @@ type XReadGroupArgs struct {
|
||||
Count int64
|
||||
Block time.Duration
|
||||
NoAck bool
|
||||
Claim time.Duration // Claim idle pending entries older than this duration
|
||||
}
|
||||
|
||||
func (c cmdable) XReadGroup(ctx context.Context, a *XReadGroupArgs) *XStreamSliceCmd {
|
||||
@@ -282,6 +283,10 @@ func (c cmdable) XReadGroup(ctx context.Context, a *XReadGroupArgs) *XStreamSlic
|
||||
args = append(args, "noack")
|
||||
keyPos++
|
||||
}
|
||||
if a.Claim > 0 {
|
||||
args = append(args, "claim", int64(a.Claim/time.Millisecond))
|
||||
keyPos += 2
|
||||
}
|
||||
args = append(args, "streams")
|
||||
keyPos++
|
||||
for _, s := range a.Streams {
|
||||
|
||||
Reference in New Issue
Block a user