Fix potential buffer overflows from invalid string size arguments

- FILENAME_MAX was used when the output was later limited by FILE_MAX.
- Some were passing in incorrect/dummy sizes in a couple of places.
This commit is contained in:
Campbell Barton
2023-04-28 21:49:05 +10:00
parent ba978e1b68
commit ff0cf45bc2
5 changed files with 13 additions and 8 deletions

View File

@@ -531,7 +531,7 @@ static bool absolute_convert_foreach_path_cb(BPathForeachPathData *bpath_data,
return false; /* Already absolute. */
}
BLI_strncpy(path_dst, path_src, FILENAME_MAX);
BLI_strncpy(path_dst, path_src, FILE_MAX);
BLI_path_abs(path_dst, data->basedir);
if (BLI_path_is_rel(path_dst) == false) {
data->count_changed++;