[PATCH] msvcrt: replaced bad memcpy by strcpy (Coverity)
marcus at jet.franken.de
Sun Oct 16 17:42:28 CDT 2011
The sizeof() here took a sizeof(char*), as sizeof() is evaluated
during compile time and does not look into the strings.
This worked fine for 32bit, as "XXX" and \0 is 4 bytes == sizeof(char*),
but is breaking for 64bit.
Just use strcpy().
dlls/msvcrt/locale.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/dlls/msvcrt/locale.c b/dlls/msvcrt/locale.c
index 6733522..c64e3d9 100644
@@ -102,7 +102,7 @@ static void remap_synonym(char *name)
TRACE(":Mapping synonym %s to %s\n",name,_country_synonyms[i+1]);
- memcpy(name, _country_synonyms[i+1], sizeof(_country_synonyms[i+1]));
+ strcpy(name, _country_synonyms[i+1]);
More information about the wine-patches