Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2009-09-29
11:47 • Closed ticket [2557796fff]: TclpAlloc() - no overflow protection plus 8 othe... artifact: 1b5ac23de4 user: dgp
11:47 • Ticket [2557796fff]: 4 changes artifact: aa455cdba4 user: dgp
2009-02-03
03:18 • Ticket [2557796fff]: 4 changes artifact: 7a5b061207 user: dgp
03:18 • Add attachment 2557796.patch to ticket [2557796fff] artifact: 8854877e67 user: dgp
2009-02-02
18:31 • New ticket [2557796fff] TclpAlloc() - no overflow protection. artifact: 5b689fab10 user: dgp

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: