Validate size.

This commit is contained in:
Bartosz Taudul 2020-02-26 22:27:10 +01:00
parent 4f052a6b9c
commit c0f49c648b

View File

@ -33,6 +33,7 @@ namespace tracy
static inline char* CopyString( const char* src, size_t sz ) static inline char* CopyString( const char* src, size_t sz )
{ {
assert( strlen( src ) == sz );
auto dst = (char*)tracy_malloc( sz + 1 ); auto dst = (char*)tracy_malloc( sz + 1 );
memcpy( dst, src, sz ); memcpy( dst, src, sz );
dst[sz] = '\0'; dst[sz] = '\0';