Tcl Source Code

Artifact [3c34688463]
Login

Artifact 3c3468846396ae104c408b2b6708f7dffbba4ca9020d7a3a35b0f6b7a6877abb:

Attachment "112e7aa36d.diff" to ticket [112e7aa36d] added by chrstphrchvz 2022-03-05 22:48:47. (unpublished)
diff --git generic/tclStringObj.c generic/tclStringObj.c
index 8f4bfb219..d1e709cfb 100644
--- generic/tclStringObj.c
+++ generic/tclStringObj.c
@@ -956,9 +956,9 @@ Tcl_SetObjLength(
 	     * Need to enlarge the buffer.
 	     */
 	    if (objPtr->bytes == tclEmptyStringRep) {
-		objPtr->bytes = (char *)ckalloc(length + 1);
+		objPtr->bytes = (char *)ckalloc((unsigned int)length + 1U);
 	    } else {
-		objPtr->bytes = (char *)ckrealloc(objPtr->bytes, length + 1);
+		objPtr->bytes = (char *)ckrealloc(objPtr->bytes, (unsigned int)length + 1U);
 	    }
 	    stringPtr->allocated = length;
 	}
@@ -1062,9 +1062,9 @@ Tcl_AttemptSetObjLength(
 	    char *newBytes;
 
 	    if (objPtr->bytes == tclEmptyStringRep) {
-		newBytes = (char *)attemptckalloc(length + 1);
+		newBytes = (char *)attemptckalloc((unsigned int)length + 1U);
 	    } else {
-		newBytes = (char *)attemptckrealloc(objPtr->bytes, length + 1);
+		newBytes = (char *)attemptckrealloc(objPtr->bytes, (unsigned int)length + 1U);
 	    }
 	    if (newBytes == NULL) {
 		return 0;