Skip to content

Commit

Permalink
don't try to copy past the end of c_execdir
Browse files Browse the repository at this point in the history
  • Loading branch information
richard-signal committed Oct 19, 2023
1 parent 9c9070f commit fc427ad
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/apps/common/apputils.c
Original file line number Diff line number Diff line change
Expand Up @@ -1157,7 +1157,7 @@ char *find_config_file(const char *config_file, int print_file_name) {
size_t celen = strlen(c_execdir);
fnsz = sizeof(char) * (dirlen + cflen + celen + 10);
fn = (char *)malloc(fnsz + 1);
strncpy(fn, c_execdir, fnsz);
strncpy(fn, c_execdir, celen);
size_t fnlen = strlen(fn);
if (fnlen < fnsz) {
strncpy(fn + fnlen, "/", fnsz - fnlen);
Expand Down

0 comments on commit fc427ad

Please sign in to comment.