summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2022-03-08 15:10:57 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2022-03-08 15:10:57 (GMT)
commit9c28f4fc5f89366f31d58cf585b33aff028ea5d6 (patch)
tree959c618ae8323d194bb1461e57d4497ce1d6050e
parent9a091756bbc40e8d359ac59e4b892c0835f57bae (diff)
downloadtcl-9c28f4fc5f89366f31d58cf585b33aff028ea5d6.zip
tcl-9c28f4fc5f89366f31d58cf585b33aff028ea5d6.tar.gz
tcl-9c28f4fc5f89366f31d58cf585b33aff028ea5d6.tar.bz2
Fix [b6afa33737]: signed integer overflow in TclInitStringRep() macro
-rw-r--r--generic/tclInt.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/generic/tclInt.h b/generic/tclInt.h
index 1954a13..89ce8f0 100644
--- a/generic/tclInt.h
+++ b/generic/tclInt.h
@@ -4316,7 +4316,7 @@ MODULE_SCOPE void TclDbInitNewObj(Tcl_Obj *objPtr, const char *file,
(objPtr)->bytes = tclEmptyStringRep; \
(objPtr)->length = 0; \
} else { \
- (objPtr)->bytes = (char *) ckalloc((len) + 1); \
+ (objPtr)->bytes = (char *) ckalloc((unsigned int)(len) + 1U); \
memcpy((objPtr)->bytes, (bytePtr), (len)); \
(objPtr)->bytes[len] = '\0'; \
(objPtr)->length = (len); \