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

Fix bug found by Coverity.

If a filename failed to be added for a readdir response, it would
have just skipped that file and continued with the files around it
rather than reporting an error.
parent 01a94bdc
No related branches found
No related tags found
No related merge requests found
Pipeline #6027 passed
......@@ -1620,7 +1620,8 @@ sftp_readdir(sftp_dirhandle_t handle, void *cb_data)
return sftps_send_error(sbbs->sftp_state, SSH_FX_FAILURE, "Longname allocation failure");
}
vpath = getfname(tmppath);
fn.add_name(strdup(vpath), lname, attr);
if (!fn.add_name(strdup(vpath), lname, attr))
return sftps_send_error(sbbs->sftp_state, SSH_FX_FAILURE, "adding static file");
}
}
else {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment