Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2010-03-24 22:52:00 +0300
committerCorinna Vinschen <corinna@vinschen.de>2010-03-24 22:52:00 +0300
commit708d2a1e64317a9537b004b1dc4fc03811a46a78 (patch)
tree884d0c4594bc7d956ec78cba780ce1aba08520a7 /winsup/utils
parent4951591733776a53e1ebac10f3e8117b7d2b3c69 (diff)
* regtool.cc (find_key): Fix allocation size of "value".
Diffstat (limited to 'winsup/utils')
-rw-r--r--winsup/utils/ChangeLog4
-rw-r--r--winsup/utils/regtool.cc4
2 files changed, 6 insertions, 2 deletions
diff --git a/winsup/utils/ChangeLog b/winsup/utils/ChangeLog
index 834bf1a6a..a354d5170 100644
--- a/winsup/utils/ChangeLog
+++ b/winsup/utils/ChangeLog
@@ -1,3 +1,7 @@
+2010-03-24 Corinna Vinschen <corinna@vinschen.de>
+
+ * regtool.cc (find_key): Fix allocation size of "value".
+
2010-03-23 Corinna Vinschen <corinna@vinschen.de>
* locale.cc (add_locale_alias_locales): Always use loc_num at function
diff --git a/winsup/utils/regtool.cc b/winsup/utils/regtool.cc
index 487e779db..d8a492c37 100644
--- a/winsup/utils/regtool.cc
+++ b/winsup/utils/regtool.cc
@@ -377,7 +377,7 @@ find_key (int howmanyparts, REGSAM access, int option = 0)
if (value)
free (value);
len = mbstowcs (NULL, n, 0) + 1;
- value = (wchar_t *) malloc (len);
+ value = (wchar_t *) malloc (len * sizeof (wchar_t));
mbstowcs (value, n, len);
return;
}
@@ -387,7 +387,7 @@ find_key (int howmanyparts, REGSAM access, int option = 0)
if (value)
free (value);
len = mbstowcs (NULL, e + 1, 0) + 1;
- value = (wchar_t *) malloc (len);
+ value = (wchar_t *) malloc (len * sizeof (wchar_t));
mbstowcs (value, e + 1, len);
}
}