diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2012-06-21 11:31:00 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2012-06-21 11:31:00 (GMT) |
commit | 89dc338380acf9c6e134808e1575e8bf83743b91 (patch) | |
tree | 345a07a4d45b5c6e3e2cfa064544d467a26a33c5 /win/tclWinReg.c | |
parent | 989a8101fcd98ea1768732253c10b554aa99f9be (diff) | |
parent | 47f8473fed8224fbbb75d6cb95406cd13af68070 (diff) | |
download | tcl-89dc338380acf9c6e134808e1575e8bf83743b91.zip tcl-89dc338380acf9c6e134808e1575e8bf83743b91.tar.gz tcl-89dc338380acf9c6e134808e1575e8bf83743b91.tar.bz2 |
[Bug 3362446]: possible allocation error when using UNICODE
Diffstat (limited to 'win/tclWinReg.c')
-rw-r--r-- | win/tclWinReg.c | 4 |
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); } |