Skip to content
Snippets Groups Projects
Commit 4df9c658 authored by Deucе's avatar Deucе :ok_hand_tone4:
Browse files

Not all snprintf()s terminate.

parent e4adbcb5
No related branches found
No related tags found
No related merge requests found
......@@ -1384,7 +1384,8 @@ sftp_readdir(sftp_dirhandle_t handle, void *cb_data)
if (dd->info.rootdir.idx == dotdot) {
if (pm->sftp_patt[1]) {
char *dir = const_cast<char *>("..");
snprintf(tmppath, sizeof(tmppath) - 2 /* for dir */, pm->sftp_patt, sbbs->useron.alias);
snprintf(tmppath, sizeof(tmppath) - 3 /* for dir */, pm->sftp_patt, sbbs->useron.alias);
tmppath[sizeof(tmppath) - 2] = 0;
strcat(tmppath, dir);
return generic_dot_realpath_entry(sbbs, dir, tmppath, &dd->info.rootdir.idx);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment