Tcl Source Code

Check-in [08603ee649]
Login

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

Overview
Comment:Bug [cfdf80a2efc6] - zlib checksum is negative
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk | main
Files: files | file ages | folders
SHA3-256: 08603ee649a6456f7baac73af99df9042013c6fc58198099d3becf5b2a7acc06
User & Date: apnadkarni 2024-07-11 15:17:23.020
References
2024-08-30
17:37
Merge [08603ee649a6456f]: Fix [cfdf80a2efc6] - zlib checksum is negative. check-in: e6480da097 user: pooryorick tags: unchained, INCOMPATIBLE_LICENSE
2024-07-14
01:04 New ticket [ae09f6b190] Mem leak in trunk. artifact: cd4fbfb60a user: pointsman
Context
2024-10-18
15:06
Fix [73d5cb615e]: zlib-8.8, zlib-8.16 fail on Fedora 40, gcc 14.1.1 backport [cfdf80a2efc6]: zlib ch... check-in: 81ad0315e2 user: jan.nijtmans tags: core-8-6-branch
2024-08-30
17:37
Merge [08603ee649a6456f]: Fix [cfdf80a2efc6] - zlib checksum is negative. check-in: e6480da097 user: pooryorick tags: unchained, INCOMPATIBLE_LICENSE
2024-07-14
19:20
merge 8.7, actual state of [info vars], before fix [0e4b7fce57] global vars still resolved in namesp... check-in: aa039328b4 user: sebres tags: trunk, main
13:49
Fix [0e4b7fce57]: Running [info vars] in a namespace returns global variables. check-in: 3d8bf31bdc user: sbron tags: bug-0e4b7fce57
2024-07-11
15:17
Bug [cfdf80a2efc6] - zlib checksum is negative check-in: 08603ee649 user: apnadkarni tags: trunk, main
2024-07-10
09:52
Optimization: two more objTypes which always have length 1 when viewed as a list check-in: 4c75553894 user: jan.nijtmans tags: trunk, main
Changes
Unified Diff Ignore Whitespace Patch
Changes to generic/tclZlib.c.
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
	return TCL_OK;
    case zs_checksum:		/* $strm checksum */
	if (objc != 2) {
	    Tcl_WrongNumArgs(interp, 2, objv, NULL);
	    return TCL_ERROR;
	}
	Tcl_SetObjResult(interp, Tcl_NewWideIntObj(
		Tcl_ZlibStreamChecksum(zstream)));
	return TCL_OK;
    case zs_reset:		/* $strm reset */
	if (objc != 2) {
	    Tcl_WrongNumArgs(interp, 2, objv, NULL);
	    return TCL_ERROR;
	}
	return Tcl_ZlibStreamReset(zstream);







|







2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
	return TCL_OK;
    case zs_checksum:		/* $strm checksum */
	if (objc != 2) {
	    Tcl_WrongNumArgs(interp, 2, objv, NULL);
	    return TCL_ERROR;
	}
	Tcl_SetObjResult(interp, Tcl_NewWideIntObj(
		(uint32_t) Tcl_ZlibStreamChecksum(zstream)));
	return TCL_OK;
    case zs_reset:		/* $strm reset */
	if (objc != 2) {
	    Tcl_WrongNumArgs(interp, 2, objv, NULL);
	    return TCL_ERROR;
	}
	return Tcl_ZlibStreamReset(zstream);
Changes to tests/zlib.test.
1148
1149
1150
1151
1152
1153
1154










1155
1156
1157
1158
1159
1160
1161
	lappend result $size $size2 ->$size3
    }
    return $result
} -cleanup {
    chan close $src
    chan close $dst
} -result {5 5 ->5 5 5 ->5 5 5 ->5}












::tcltest::cleanupTests
return

# Local Variables:
# mode: tcl







>
>
>
>
>
>
>
>
>
>







1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
	lappend result $size $size2 ->$size3
    }
    return $result
} -cleanup {
    chan close $src
    chan close $dst
} -result {5 5 ->5 5 5 ->5 5 5 ->5}

test zlib-15.1 {Bug cfdf80a2efc6 - negative checksums} -setup {
    set compressor [zlib stream gzip -header {comment "A zlib demo"}]
    $compressor put abcd
    $compressor finalize
} -body {
    $compressor checksum
} -cleanup {
    $compressor close
} -result 3984772369


::tcltest::cleanupTests
return

# Local Variables:
# mode: tcl