Tcl Source Code

Check-in [268122a79b]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:[Bug 3496014] Protect Tcl_SetByteArrayObj for invalid values (Backported from Tcl 8.6)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | core-8-5-branch
Files: files | file ages | folders
SHA1: 268122a79bdb4b5cf98798b58e1a7ad9d8ab0aa8
User & Date: jan.nijtmans 2012-08-23 12:07:22
Context
2012-08-23
20:06
small wrapper for TclWinNToHs, for change in calling convention check-in: 624e7971f7 user: jan.nijtmans tags: core-8-5-branch
12:11
[Bug 3496014] Unecessary memset() in Tcl_SetByteArrayObj(). check-in: f61c86cef1 user: jan.nijtmans tags: trunk
12:07
[Bug 3496014] Protect Tcl_SetByteArrayObj for invalid values (Backported from Tcl 8.6) check-in: 268122a79b user: jan.nijtmans tags: core-8-5-branch
2012-08-20
23:45
3559678 Fix bad filename normalization when the last component is the empty string. check-in: 0b332ef62e user: dgp tags: core-8-5-branch
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to ChangeLog.






1
2
3
4
5
6
7





2012-08-20  Don Porter  <[email protected]>

	* generic/tclPathObj.c:	[Bug 3559678] Fix bad filename normalization
	when the last component is the empty string.

2012-08-20  Jan Nijtmans  <[email protected]>

>
>
>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
2012-08-23  Jan Nijtmans  <[email protected]>

	* generic/tclBinary.c: [Bug 3496014] (Backport from Tcl 8.6) Protect
	Tcl_SetByteArrayObj for invalid values.

2012-08-20  Don Porter  <[email protected]>

	* generic/tclPathObj.c:	[Bug 3559678] Fix bad filename normalization
	when the last component is the empty string.

2012-08-20  Jan Nijtmans  <[email protected]>

Changes to generic/tclBinary.c.

269
270
271
272
273
274
275



276
277
278

279

280
281
282
283
284
285
286

    if (Tcl_IsShared(objPtr)) {
	Tcl_Panic("%s called with shared object", "Tcl_SetByteArrayObj");
    }
    TclFreeIntRep(objPtr);
    Tcl_InvalidateStringRep(objPtr);




    byteArrayPtr = (ByteArray *) ckalloc(BYTEARRAY_SIZE(length));
    byteArrayPtr->used = length;
    byteArrayPtr->allocated = length;

    memcpy(byteArrayPtr->bytes, bytes, (size_t) length);


    objPtr->typePtr = &tclByteArrayType;
    SET_BYTEARRAY(objPtr, byteArrayPtr);
}

/*
 *----------------------------------------------------------------------







>
>
>



>
|
>







269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291

    if (Tcl_IsShared(objPtr)) {
	Tcl_Panic("%s called with shared object", "Tcl_SetByteArrayObj");
    }
    TclFreeIntRep(objPtr);
    Tcl_InvalidateStringRep(objPtr);

    if (length < 0) {
	length = 0;
    }
    byteArrayPtr = (ByteArray *) ckalloc(BYTEARRAY_SIZE(length));
    byteArrayPtr->used = length;
    byteArrayPtr->allocated = length;
    if (length && bytes) {
	memcpy(byteArrayPtr->bytes, bytes, (size_t) length);
    }

    objPtr->typePtr = &tclByteArrayType;
    SET_BYTEARRAY(objPtr, byteArrayPtr);
}

/*
 *----------------------------------------------------------------------