initialize padding of CvString with zeros

This commit is contained in:
Ilya Lavrenov 2015-09-03 17:21:04 +03:00 committed by Dikay900
parent ee2008abe8
commit df21a24f81

View File

@ -352,6 +352,7 @@ CV_IMPL CvString
cvMemStorageAllocString( CvMemStorage* storage, const char* ptr, int len ) cvMemStorageAllocString( CvMemStorage* storage, const char* ptr, int len )
{ {
CvString str; CvString str;
memset(&str, 0, sizeof(CvString));
str.len = len >= 0 ? len : (int)strlen(ptr); str.len = len >= 0 ? len : (int)strlen(ptr);
str.ptr = (char*)cvMemStorageAlloc( storage, str.len + 1 ); str.ptr = (char*)cvMemStorageAlloc( storage, str.len + 1 );