1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-29 23:33:05 +04:00

Merge pull request #23729 from asmorkalov:as/create_samples_overflow

Fixed potential buffer overflow of user file name in create_samples_app
This commit is contained in:
Alexander Smorkalov
2023-06-03 10:13:11 +03:00
committed by GitHub
+3 -2
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( ; ; )