| Summary: | unchecked returned value from ftruncate | ||||||
|---|---|---|---|---|---|---|---|
| Product: | Portable OpenSSH | Reporter: | Loganaden Velvindron <loganaden> | ||||
| Component: | sftp | Assignee: | Assigned to nobody <unassigned-bugs> | ||||
| Status: | CLOSED FIXED | ||||||
| Severity: | minor | CC: | djm, dtucker | ||||
| Priority: | P5 | ||||||
| Version: | -current | ||||||
| Hardware: | All | ||||||
| OS: | All | ||||||
| Bug Depends on: | |||||||
| Bug Blocks: | 2360 | ||||||
| Attachments: |
|
||||||
Comment on attachment 2378 [details] sftp_unchecked_return > debug("truncating at %llu", (unsigned long long)highwater); >- ftruncate(local_fd, highwater); >+ if (ftruncate(local_fd, highwater) == -1) { >+ error("Unable to truncate \"%s\"", local_path); >+ } Please add strerror(errno) to the error text to provide a hint about what happened. >- Please remove the whitespace change. applied with darren's changes Set all RESOLVED bugs to CLOSED with release of OpenSSH 7.1 |
Created attachment 2378 [details] sftp_unchecked_return @@ -1253,7 +1253,9 @@ do_download(struct sftp_conn *conn, char "server reordered requests", local_path); } debug("truncating at %llu", (unsigned long long)highwater); - ftruncate(local_fd, highwater); ftruncate value isn't checked.