BugFix: fix ssl cert load crash issue
This commit is contained in:
@@ -1454,8 +1454,14 @@ int config_addtional_file(void *data, int argc, char *argv[])
|
||||
if (conf_file[0] != '/') {
|
||||
safe_strncpy(file_path_dir, conf_get_conf_file(), DNS_MAX_PATH);
|
||||
dirname(file_path_dir);
|
||||
if (snprintf(file_path, DNS_MAX_PATH, "%s/%s", file_path_dir, conf_file) < 0) {
|
||||
return -1;
|
||||
if (strncmp(file_path_dir, conf_get_conf_file(), sizeof(file_path_dir)) == 0) {
|
||||
if (snprintf(file_path, DNS_MAX_PATH, "%s", conf_file) < 0) {
|
||||
return -1;
|
||||
}
|
||||
} else {
|
||||
if (snprintf(file_path, DNS_MAX_PATH, "%s/%s", file_path_dir, conf_file) < 0) {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
safe_strncpy(file_path, conf_file, DNS_MAX_PATH);
|
||||
|
||||
Reference in New Issue
Block a user