variable 'output_dir' declared here, without initialization:
|
char output_dir[MAX_FILENAME_LEN]; |
the value of 'output_dir' is set in if block;
|
if (glb_config->filename) { |
|
strncpy_s(output_dir, MAX_FILENAME_LEN, glb_config->filename, (MAX_FILENAME_LEN-1)); |
|
|
|
/* create a directory to place all of the output files into */ |
|
memset_s(&st, sizeof(struct stat), 0x00, sizeof(struct stat)); |
|
if (stat(output_dir, &st) == -1) { |
|
#ifdef WIN32 |
|
mkdir(output_dir); |
|
#else |
|
tmp_ret = mkdir(output_dir, 0700); |
|
if (tmp_ret < 0) { |
|
joy_log_err("Error creating directory: %s\n", output_dir); |
|
return tmp_ret; |
|
} |
|
#endif |
|
} |
|
} |
while using this variable such as in line 994, may a potential uninitialized variable is used:
|
sprintf(full_path_output, "%s/%s_%d_json%s", output_dir, ent->d_name, fc_cnt, zsuffix); |