--- netkit-rsh-0.17/rcp/rcp.c 2021-06-20 10:00:32.217461994 +0100 +++ netkit-rsh-0.17/rcp/rcp.c 2021-06-20 10:10:32.927584394 +0100 @@ -717,8 +717,9 @@ size = size * 10 + (*cp++ - '0'); if (*cp++ != ' ') SCREWUP("size not delimited"); - if ((strchr(cp, '/') != NULL) || (strcmp(cp, "..") == 0)) { - error("rcp: unexpected filename: %s", cp); + if (*cp == '\0' || strchr(cp, '/') != NULL || + strcmp(cp, ".") == 0 || strcmp(cp, "..") == 0) { + error("error: unexpected filename: %s", cp); exit(1); } if (targisdir) {