proost commented on code in PR #203:
URL: https://github.com/apache/datasketches-go/pull/203#discussion_r4430769244


##########
hll/coupon_hash_set.go:
##########
@@ -228,6 +228,13 @@ func deserializeCouponHashSet(byteArray []byte) 
(hllCoupon, error) {
                        return nil, err
                }
        }
+       arrInts := couponCount
+       if !memIsCompact {
+               arrInts = 1 << lgCouponArrInts
+       }
+       if lgCouponArrInts > lgConfigK || couponCount > 1<<lgCouponArrInts || 
len(byteArray) < memArrStart+(arrInts<<2) {

Review Comment:
   ` lgCouponArrInts > lgConfigK-3 ||
        resizeDenom*couponCount > resizeNumber<<lgCouponArrInts`
   
   I ran fuzz testing locally, But I found growing without limit.



##########
hll/coupon_list.go:
##########
@@ -190,6 +190,9 @@ func deserializeCouponList(byteArray []byte) (hllCoupon, 
error) {
                return nil, err
        }
        couponCount := extractListCount(byteArray)
+       if couponCount > len(list.couponIntArr) || len(byteArray) < 
listIntArrStart+(couponCount<<2) {

Review Comment:
   `couponCount >= len(list.couponIntArr)`



##########
hll/aux_hash_map.go:
##########
@@ -63,6 +63,13 @@ func deserializeAuxHashMap(byteArray []byte, offset int, 
lgConfigL int, auxCount
                lgAuxArrInts = extractLgArr(byteArray)
        }
 
+       arrInts := auxCount
+       if !srcCompact {
+               arrInts = 1 << lgAuxArrInts
+       }
+       if lgAuxArrInts > lgConfigL || auxCount > 1<<lgAuxArrInts || 
len(byteArray) < offset+(arrInts<<2) {

Review Comment:
   `lgAuxArrInts >= lgConfigL` 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to