From 418709899d72656f8cbaa559c3473e582c9c5269 Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Sun, 31 Oct 2010 01:41:19 +0000 Subject: [PATCH] * regtool.c (cmd_set): Write correct number of bytes for REG_MULTI_SZ case. --- winsup/utils/ChangeLog | 7 ++++++- winsup/utils/regtool.cc | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/winsup/utils/ChangeLog b/winsup/utils/ChangeLog index 93a94dca5..b0278c587 100644 --- a/winsup/utils/ChangeLog +++ b/winsup/utils/ChangeLog @@ -1,3 +1,8 @@ +2010-10-30 Dmitry Potapov + + * regtool.c (cmd_set): Write correct number of bytes for REG_MULTI_SZ + case. + 2010-09-06 Corinna Vinschen * cygpath.cc (RtlEqualUnicodePathPrefix): New helper function. @@ -1370,7 +1375,7 @@ 2006-10-16 Corinna Vinschen - * regtool.cc (KEY_WOW64_64KEY): Drop definition. Instead define + * regtool.cc (KEY_WOW64_64KEY): Drop definition. Instead define WINVER to 0x0502 before including windows.h. 2006-10-16 Corinna Vinschen diff --git a/winsup/utils/regtool.cc b/winsup/utils/regtool.cc index c51479d60..0da7ecad0 100644 --- a/winsup/utils/regtool.cc +++ b/winsup/utils/regtool.cc @@ -711,7 +711,7 @@ cmd_set () n += mbstowcs ((wchar_t *) data + n, argv[i], max_n - n) + 1; ((wchar_t *)data)[n] = L'\0'; rv = RegSetValueExW (key, value, 0, REG_MULTI_SZ, (const BYTE *) data, - (max_n + 1) * sizeof (wchar_t)); + (n + 1) * sizeof (wchar_t)); break; case REG_AUTO: rv = ERROR_SUCCESS;