Fixed potential buffer overflow of user file name in create_samples_app

This commit is contained in:
Alexander Smorkalov 2023-06-02 10:33:24 +03:00
parent d1b158b9dd
commit 66f86e898c

View File

@ -70,7 +70,7 @@ using namespace cv;
static int icvMkDir( const char* filename )
{
char path[PATH_MAX];
char path[PATH_MAX+1];
char* p;
int pos;
@ -83,7 +83,8 @@ static int icvMkDir( const char* filename )
mode = 0755;
#endif /* _WIN32 */
strcpy( path, filename );
path[0] = '\0';
strncat( path, filename, PATH_MAX );
p = path;
for( ; ; )