Overview
| Comment: | Since we allocate an extra byte (for terminating NUL), overflow protection has to keep the needed string length strictly less than INT_MAX. EDIT: Sorry, that was wrong, for a slightly tricky reason. The objPtr->length field is type int, so must be limited to INT_MAX. That's the limit to protect. The memory allocation routines accept (unsigned int) argument as the number of bytes to allocate, so they can accept a request for INT_MAX + 1. |
|---|---|
| Timelines: | family | ancestors | mistake |
| Files: | files | file ages | folders |
| SHA3-256: |
2eca3128d3e92f93bb6e8811bc82fbc3 |
| User & Date: | dgp on 2020-03-27 15:46:10.925 |
| Original Comment: | Since we allocate an extra byte (for terminating NUL), overflow protection has to keep the needed string length strictly less than INT_MAX. |
| Other Links: | branch diff | manifest | tags |
Context
|
2020-03-27
| ||
| 15:46 | Since we allocate an extra byte (for terminating NUL), overflow protection has to keep the needed s... closed check-in: 2eca3128d3 user: dgp tags: mistake | |
| 10:33 | Fix [767e070d35]: Tcl_GetRange and Tcl_GetUniChar do not validate index inputs closed check-in: 89f3dff179 user: jan.nijtmans tags: bug-767e070d35 | |
Changes
Modified generic/tclStringObj.c
from [41c76b3f25]
to [a4aea3fd96].
[diff]