svn commit: r343097 - stable/11/crypto/openssh
Ed Maste
emaste at FreeBSD.org
Wed Jan 16 15:15:05 UTC 2019
Author: emaste
Date: Wed Jan 16 15:15:04 2019
New Revision: 343097
URL: https://svnweb.freebsd.org/changeset/base/343097
Log:
MFC r343043: scp: disallow empty or current directory
Obtained from: OpenBSD scp.c 1.198
Security: CVE-2018-20685
Sponsored by: The FreeBSD Foundation
Modified:
stable/11/crypto/openssh/scp.c
Directory Properties:
stable/11/ (props changed)
Modified: stable/11/crypto/openssh/scp.c
==============================================================================
--- stable/11/crypto/openssh/scp.c Wed Jan 16 15:12:19 2019 (r343096)
+++ stable/11/crypto/openssh/scp.c Wed Jan 16 15:15:04 2019 (r343097)
@@ -1047,7 +1047,8 @@ sink(int argc, char **argv)
size = size * 10 + (*cp++ - '0');
if (*cp++ != ' ')
SCREWUP("size not delimited");
- 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);
}
More information about the svn-src-all
mailing list