From 52aeccf960b732af1a39a143c332f7791c1a70f1 Mon Sep 17 00:00:00 2001 From: Piotr Caban Date: Wed, 28 Aug 2013 15:13:54 +0200 Subject: [PATCH] msvcp90: Fix string leak in locale__Locimp__Makeloc function. --- dlls/msvcp100/locale.c | 2 +- dlls/msvcp100/msvcp.h | 1 + dlls/msvcp60/locale.c | 2 +- dlls/msvcp60/msvcp.h | 1 + dlls/msvcp71/locale.c | 2 +- dlls/msvcp71/msvcp.h | 1 + dlls/msvcp90/locale.c | 2 +- dlls/msvcp90/msvcp90.h | 1 + 8 files changed, 8 insertions(+), 4 deletions(-) diff --git a/dlls/msvcp100/locale.c b/dlls/msvcp100/locale.c index e0585bcde86..19aaef966ec 100644 --- a/dlls/msvcp100/locale.c +++ b/dlls/msvcp100/locale.c @@ -8460,7 +8460,7 @@ locale__Locimp* __cdecl locale__Locimp__Makeloc(const _Locinfo *locinfo, categor locale__Locimp__Makeushloc(locinfo, cat, locimp, loc); locimp->catmask |= cat; - _Yarn_char_copy_ctor(&locimp->name, &locinfo->newlocname); + _Yarn_char_op_assign(&locimp->name, &locinfo->newlocname); return locimp; } diff --git a/dlls/msvcp100/msvcp.h b/dlls/msvcp100/msvcp.h index de8d9e313a1..067ac76276b 100644 --- a/dlls/msvcp100/msvcp.h +++ b/dlls/msvcp100/msvcp.h @@ -88,6 +88,7 @@ _Yarn_char* __thiscall _Yarn_char_ctor_cstr(_Yarn_char*, const char*); _Yarn_char* __thiscall _Yarn_char_copy_ctor(_Yarn_char*, const _Yarn_char*); const char* __thiscall _Yarn_char_c_str(const _Yarn_char*); void __thiscall _Yarn_char_dtor(_Yarn_char*); +_Yarn_char* __thiscall _Yarn_char_op_assign(_Yarn_char*, const _Yarn_char*); /* class locale::facet */ typedef struct { diff --git a/dlls/msvcp60/locale.c b/dlls/msvcp60/locale.c index 7a6db3a59a4..a2ce27924a2 100644 --- a/dlls/msvcp60/locale.c +++ b/dlls/msvcp60/locale.c @@ -8110,7 +8110,7 @@ static locale__Locimp* locale__Locimp__Makeloc(const _Locinfo *locinfo, category locale__Locimp__Makeushloc(locinfo, cat, locimp, loc); locimp->catmask |= cat; - basic_string_char_copy_ctor(&locimp->name, &locinfo->newlocname); + basic_string_char_assign(&locimp->name, &locinfo->newlocname); return locimp; } diff --git a/dlls/msvcp60/msvcp.h b/dlls/msvcp60/msvcp.h index cc0e6885ee0..0a8c57cddfd 100644 --- a/dlls/msvcp60/msvcp.h +++ b/dlls/msvcp60/msvcp.h @@ -51,6 +51,7 @@ void basic_string_char_clear(basic_string_char*); basic_string_char* __thiscall basic_string_char_append_ch(basic_string_char*, char); MSVCP_size_t __thiscall basic_string_char_length(const basic_string_char*); basic_string_char* __thiscall basic_string_char_append_len_ch(basic_string_char*, MSVCP_size_t, char); +basic_string_char* __thiscall basic_string_char_assign(basic_string_char*, const basic_string_char*); typedef struct { diff --git a/dlls/msvcp71/locale.c b/dlls/msvcp71/locale.c index 4268566d2be..2cb7bd7e456 100644 --- a/dlls/msvcp71/locale.c +++ b/dlls/msvcp71/locale.c @@ -8651,7 +8651,7 @@ static locale__Locimp* locale__Locimp__Makeloc(const _Locinfo *locinfo, category locale__Locimp__Makeushloc(locinfo, cat, locimp, loc); locimp->catmask |= cat; - MSVCP_basic_string_char_copy_ctor(&locimp->name, &locinfo->newlocname); + MSVCP_basic_string_char_assign(&locimp->name, &locinfo->newlocname); return locimp; } diff --git a/dlls/msvcp71/msvcp.h b/dlls/msvcp71/msvcp.h index 5500ebabfab..bf720813239 100644 --- a/dlls/msvcp71/msvcp.h +++ b/dlls/msvcp71/msvcp.h @@ -55,6 +55,7 @@ const char* __stdcall MSVCP_basic_string_char_c_str(const basic_string_char*); void __thiscall MSVCP_basic_string_char_clear(basic_string_char*); basic_string_char* __thiscall MSVCP_basic_string_char_append_ch(basic_string_char*, char); MSVCP_size_t __thiscall MSVCP_basic_string_char_length(const basic_string_char*); +basic_string_char* __thiscall MSVCP_basic_string_char_assign(basic_string_char*, const basic_string_char*); #define BUF_SIZE_WCHAR 8 typedef struct diff --git a/dlls/msvcp90/locale.c b/dlls/msvcp90/locale.c index 5e11ecef876..a07b9d152a8 100644 --- a/dlls/msvcp90/locale.c +++ b/dlls/msvcp90/locale.c @@ -8949,7 +8949,7 @@ locale__Locimp* __cdecl locale__Locimp__Makeloc(const _Locinfo *locinfo, categor locale__Locimp__Makeushloc(locinfo, cat, locimp, loc); locimp->catmask |= cat; - MSVCP_basic_string_char_copy_ctor(&locimp->name, &locinfo->newlocname); + MSVCP_basic_string_char_assign(&locimp->name, &locinfo->newlocname); return locimp; } diff --git a/dlls/msvcp90/msvcp90.h b/dlls/msvcp90/msvcp90.h index 95b0d0a3566..59f85445024 100644 --- a/dlls/msvcp90/msvcp90.h +++ b/dlls/msvcp90/msvcp90.h @@ -55,6 +55,7 @@ const char* __stdcall MSVCP_basic_string_char_c_str(const basic_string_char*); void __thiscall MSVCP_basic_string_char_clear(basic_string_char*); basic_string_char* __thiscall MSVCP_basic_string_char_append_ch(basic_string_char*, char); MSVCP_size_t __thiscall MSVCP_basic_string_char_length(const basic_string_char*); +basic_string_char* __thiscall MSVCP_basic_string_char_assign(basic_string_char*, const basic_string_char*); #define BUF_SIZE_WCHAR 8 typedef struct