summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2012-06-21 11:31:00 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2012-06-21 11:31:00 (GMT)
commit89dc338380acf9c6e134808e1575e8bf83743b91 (patch)
tree345a07a4d45b5c6e3e2cfa064544d467a26a33c5
parent989a8101fcd98ea1768732253c10b554aa99f9be (diff)
parent47f8473fed8224fbbb75d6cb95406cd13af68070 (diff)
downloadtcl-89dc338380acf9c6e134808e1575e8bf83743b91.zip
tcl-89dc338380acf9c6e134808e1575e8bf83743b91.tar.gz
tcl-89dc338380acf9c6e134808e1575e8bf83743b91.tar.bz2
[Bug 3362446]: possible allocation error when using UNICODE
-rw-r--r--win/tclWinReg.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/win/tclWinReg.c b/win/tclWinReg.c
index ee0c243..c508fdf 100644
--- a/win/tclWinReg.c
+++ b/win/tclWinReg.c
@@ -765,7 +765,7 @@ GetValue(
*/
Tcl_DStringInit(&data);
- Tcl_DStringSetLength(&data, (int) TCL_DSTRING_STATIC_SIZE - 1);
+ Tcl_DStringSetLength(&data, TCL_DSTRING_STATIC_SIZE - 1);
length = TCL_DSTRING_STATIC_SIZE/sizeof(TCHAR) - 1;
valueName = Tcl_GetStringFromObj(valueNameObj, &nameLen);
@@ -781,7 +781,7 @@ GetValue(
*/
length *= 2;
- Tcl_DStringSetLength(&data, (int) length);
+ Tcl_DStringSetLength(&data, (int) length * sizeof(TCHAR));
result = RegQueryValueEx(key, nativeValue,
NULL, &type, (BYTE *) Tcl_DStringValue(&data), &length);
}