• Oran Agra's avatar
    Fix ziplist and listpack overflows and truncations (CVE-2021-32627, CVE-2021-32628) · 6facfb7a
    Oran Agra authored
    - fix possible heap corruption in ziplist and listpack resulting by trying to
      allocate more than the maximum size of 4GB.
    - prevent ziplist (hash and zset) from reaching size of above 1GB, will be
      converted to HT encoding, that's not a useful size.
    - prevent listpack (stream) from reaching size of above 1GB.
    - XADD will start a new listpack if the new record may cause the previous
      listpack to grow over 1GB.
    - XADD will respond with an error if a single stream record is over 1GB
    - List type (ziplist in quicklist) was truncating strings that were over 4GB,
      now it'll respond with an error.
    
    (cherry picked from commit 68e221a3f98a427805d31c1760b4cdf37ba810ab)
    6facfb7a
util.tcl 11.4 KB