mirror of
https://github.com/opencv/opencv.git
synced 2024-11-27 20:50:25 +08:00
Fixed potential buffer overflow of user file name in create_samples_app
This commit is contained in:
parent
d1b158b9dd
commit
66f86e898c
@ -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…
Reference in New Issue
Block a user