summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2022-02-23 14:24:15 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2022-02-23 14:24:15 (GMT)
commit21d713fe09d0989cd5661b02ae415537c7863826 (patch)
tree4f6078569b53c681de2e50f234378ff1714ea213
parentc736c693049e659603b5cc2efb22092d921cc250 (diff)
downloadtcl-21d713fe09d0989cd5661b02ae415537c7863826.zip
tcl-21d713fe09d0989cd5661b02ae415537c7863826.tar.gz
tcl-21d713fe09d0989cd5661b02ae415537c7863826.tar.bz2
Fix [d282fcacd1]: signed integer overflow in ScanNumber()
-rw-r--r--generic/tclBinary.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/generic/tclBinary.c b/generic/tclBinary.c
index 5d317fa..fdb7f59 100644
--- a/generic/tclBinary.c
+++ b/generic/tclBinary.c
@@ -2102,12 +2102,12 @@ ScanNumber(
value = (long) (buffer[0]
+ (buffer[1] << 8)
+ (buffer[2] << 16)
- + (((long)buffer[3]) << 24));
+ + (((unsigned long)buffer[3]) << 24));
} else {
value = (long) (buffer[3]
+ (buffer[2] << 8)
+ (buffer[1] << 16)
- + (((long) buffer[0]) << 24));
+ + (((unsigned long) buffer[0]) << 24));
}
/*