diff --git a/dlls/engine/CString.h b/dlls/engine/CString.h index 4fe52b15..14b86509 100755 --- a/dlls/engine/CString.h +++ b/dlls/engine/CString.h @@ -107,8 +107,10 @@ public: { clear(); } else { - Grow(strlen(d) + 1, false); - strcpy(v, d); + size_t len = strlen(d); + Grow(len + 1, false); + memcpy(v, d, len); + v[len] = '\0'; } } @@ -118,7 +120,7 @@ public: v[0] = '\0'; } - int compare (const char *d) + int compare (const char *d) const { if (!v) return strcmp("", d); diff --git a/dlls/nvault/CString.h b/dlls/nvault/CString.h index 4fe52b15..14b86509 100755 --- a/dlls/nvault/CString.h +++ b/dlls/nvault/CString.h @@ -107,8 +107,10 @@ public: { clear(); } else { - Grow(strlen(d) + 1, false); - strcpy(v, d); + size_t len = strlen(d); + Grow(len + 1, false); + memcpy(v, d, len); + v[len] = '\0'; } } @@ -118,7 +120,7 @@ public: v[0] = '\0'; } - int compare (const char *d) + int compare (const char *d) const { if (!v) return strcmp("", d); diff --git a/dlls/sqlite/CString.h b/dlls/sqlite/CString.h index 4fe52b15..14b86509 100755 --- a/dlls/sqlite/CString.h +++ b/dlls/sqlite/CString.h @@ -107,8 +107,10 @@ public: { clear(); } else { - Grow(strlen(d) + 1, false); - strcpy(v, d); + size_t len = strlen(d); + Grow(len + 1, false); + memcpy(v, d, len); + v[len] = '\0'; } } @@ -118,7 +120,7 @@ public: v[0] = '\0'; } - int compare (const char *d) + int compare (const char *d) const { if (!v) return strcmp("", d);