scp: disallow empty or current directory
Obtained from: OpenBSD scp.c 1.198 Security: CVE-2018-20685 Sponsored by: The FreeBSD Foundation
This commit is contained in:
parent
cd0c606fda
commit
d366f891b1
@ -1106,7 +1106,8 @@ sink(int argc, char **argv)
|
||||
SCREWUP("size out of range");
|
||||
size = (off_t)ull;
|
||||
|
||||
if ((strchr(cp, '/') != NULL) || (strcmp(cp, "..") == 0)) {
|
||||
if (*cp == '\0' || strchr(cp, '/') != NULL ||
|
||||
strcmp(cp, ".") == 0 || strcmp(cp, "..") == 0) {
|
||||
run_err("error: unexpected filename: %s", cp);
|
||||
exit(1);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user