Tcl Source Code

Check-in [8e35530849]
Login

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

Overview
Comment:3371644 Repair failure to properly handle (length == -1) in TclConvertElement().
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 8e355308497b5beaf86055f64460cab0ce21e988
User & Date: dgp 2011-07-19 19:31:31
Context
2011-07-21
16:36
[Bug 3372130] Fix hypot math function with MSVC10 check-in: eb36f33d12 user: jan.nijtmans tags: trunk
2011-07-19
19:42
merge to rc check-in: b2cc6298a4 user: dgp tags: core-8-6-b2-rc
19:31
3371644 Repair failure to properly handle (length == -1) in TclConvertElement(). check-in: 8e35530849 user: dgp tags: trunk
19:26
3371644 Repair failure to properly handle (length == -1) in TclConvertElement(). check-in: 720e2e9c56 user: dgp tags: core-8-5-branch
18:13
Fix [bug 3371644] -- crash on Tcl_ConvertElement with leading pound. check-in: 4fadf0bce5 user: ferrieux tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to ChangeLog.

1
2
3


4
5
6
7
8
9
10
2011-07-19 Alexandre Ferrieux  <ferrieux@users.sourceforge.net>

	* generic/tclUtil.c: Fix [bug 3371644] -- crash on Tcl_ConvertElement with leading pound.



2011-07-19  Donal K. Fellows  <[email protected]>

	* doc/*.3, doc/*.n: Many small fixes to documentation as part of
	project to improve quality of generated HTML docs.

	* tools/tcltk-man2html.tcl (remap_link_target): More complete set of
|

|
>
>







1
2
3
4
5
6
7
8
9
10
11
12
2011-07-19  Don Porter  <dgp@users.sourceforge.net>

	* generic/tclUtil.c:	[Bug 3371644] Repair failure to properly handle 
	* tests/util.test: (length == -1) scanning in TclConvertElement().
	Thanks to Thomas Sader and Alexandre Ferrieux.

2011-07-19  Donal K. Fellows  <[email protected]>

	* doc/*.3, doc/*.n: Many small fixes to documentation as part of
	project to improve quality of generated HTML docs.

	* tools/tcltk-man2html.tcl (remap_link_target): More complete set of

Changes to generic/tclUtil.c.

1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
    /* Escape leading hash as needed and requested. */
    if ((*src == '#') && !(flags & TCL_DONT_QUOTE_HASH)) {
	if (conversion == CONVERT_ESCAPE) {
	    p[0] = '\\';
	    p[1] = '#';
	    p += 2;
	    src++;
	    if (length > 0) {
		length--;
	    }
	} else {
	    conversion = CONVERT_BRACE;
	}
    }

    /* No escape or quoting needed.  Copy the literal string value. */
    if (conversion == CONVERT_NONE) {







|
<
<







1257
1258
1259
1260
1261
1262
1263
1264


1265
1266
1267
1268
1269
1270
1271
    /* Escape leading hash as needed and requested. */
    if ((*src == '#') && !(flags & TCL_DONT_QUOTE_HASH)) {
	if (conversion == CONVERT_ESCAPE) {
	    p[0] = '\\';
	    p[1] = '#';
	    p += 2;
	    src++;
	    length -= (length > 0);


	} else {
	    conversion = CONVERT_BRACE;
	}
    }

    /* No escape or quoting needed.  Copy the literal string value. */
    if (conversion == CONVERT_NONE) {

Changes to tests/util.test.

171
172
173
174
175
176
177






178
179
180
181
182
183
184
    proc #\{ {} {return #}
    set cmd [list #\{]
    append cmd ""	;# force string rep generation
    set result [eval $cmd]
    rename #\{ {}
    set result
} {#}







test util-4.1 {Tcl_ConcatObj - backslash-space at end of argument} {
    concat a {b\ } c
} {a b\  c}
test util-4.2 {Tcl_ConcatObj - backslash-space at end of argument} {
    concat a {b\   } c
} {a b\  c}







>
>
>
>
>
>







171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
    proc #\{ {} {return #}
    set cmd [list #\{]
    append cmd ""	;# force string rep generation
    set result [eval $cmd]
    rename #\{ {}
    set result
} {#}
test util-3.6 {Tcl_ConvertElement, Bug 3371644} {
    interp create #\\
    interp alias {} x #\\ concat
    interp target {} x ;# Crash if bug not fixed
    interp delete #\\
} {}

test util-4.1 {Tcl_ConcatObj - backslash-space at end of argument} {
    concat a {b\ } c
} {a b\  c}
test util-4.2 {Tcl_ConcatObj - backslash-space at end of argument} {
    concat a {b\   } c
} {a b\  c}