Merge pull request #23729 from asmorkalov:as/create_samples_overflow

Fixed potential buffer overflow of user file name in create_samples_app
pull/23768/head
Alexander Smorkalov 2 years ago committed by GitHub
commit 84457a5dcd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      apps/createsamples/utility.cpp

@ -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( ; ; )

Loading…
Cancel
Save