Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 556dc506b6efff160ae3d17c5df199c32c05c9d38359506e38dc9f12834079d2
Ticket: c9663296fd31fbb2fa1ff1cf019b59f432983516
GrowStringBuffer and GrowUnicodeBuffer do not check for overflows
User & Date: apnadkarni on 2023-04-23 02:51:55
Changes

  1. comment changed to:
    On reallocations, `GrowStringBuffer` doubles the requested size without checking for integer overflow. This applies to 8.7 and 9.0 (may be even earlier).
    
    On the second attempt, it limits the size to `INT_MAX` which is no longer the limit in 64-bit 9.0 (should be TCL_SIZE_MAX).
    
    Just noting for now for future correction. The doubling every time also has to be reconsidered as it wastes a lot of memory once sizes get large (bigdata tests) causing memory exhaustion panics when there should not be.
    
    Same is true of GrowUnicodeBuffer
    
  2. login: "apnadkarni"
  3. mimetype: "text/plain"
  4. severity changed to: "Severe"
  5. title changed to:
    GrowStringBuffer and GrowUnicodeBuffer do not check for overflows