Skip to content
Tcl Source Code View Ticket
Login

View Ticket

TclpAlloc() - no overflow protection

Closed / Fixed2557796fffffffffffffffffffffffffffffffffCreated 18 years agoUpdated 17 years ago
Descriptionplain2009-02-02 18:31:53
The TclpAlloc() implementation in
tclThreadAlloc.c accepts an
(unsigned int) argument "reqSize"
for the number of bytes the caller
needs.

If a value greater than
(UINT_MAX - sizeof(Block)) is passed
in, then the calculation of the total
allocation needed including overhead
will overflow the unsigned int range,
and on systems where the range of
size_t is no bigger than the range
of unsigned int, the value of "size"
will overflow and the comparions to
MAXALLOC, etc. may well return bogus
results.
dgpplain2009-02-03 03:18:11
File Added - 311742: 2557796.patch


Here's a patch.
File Added: 2557796.patch
dgpplain2009-09-29 11:47:35
fixed on all branches
dgpplain2009-09-29 11:47:39
allow_comments - 1
Log in (anonymous is fine) to add a comment.

Attachments: