comparison scp.c @ 1739:13d834efc376 fuzz

merge from main
author Matt Johnston <matt@ucc.asn.au>
date Thu, 15 Oct 2020 19:55:15 +0800
parents 3080aed32bf1
children 401d7d8c8a79
comparison
equal deleted inserted replaced
1562:768ebf737aa0 1739:13d834efc376
933 933
934 for (size = 0; isdigit(*cp);) 934 for (size = 0; isdigit(*cp);)
935 size = size * 10 + (*cp++ - '0'); 935 size = size * 10 + (*cp++ - '0');
936 if (*cp++ != ' ') 936 if (*cp++ != ' ')
937 SCREWUP("size not delimited"); 937 SCREWUP("size not delimited");
938 if ((strchr(cp, '/') != NULL) || (strcmp(cp, "..") == 0)) { 938 if (*cp == '\0' || strchr(cp, '/') != NULL ||
939 strcmp(cp, ".") == 0 || strcmp(cp, "..") == 0) {
939 run_err("error: unexpected filename: %s", cp); 940 run_err("error: unexpected filename: %s", cp);
940 exit(1); 941 exit(1);
941 } 942 }
942 if (targisdir) { 943 if (targisdir) {
943 static char *namebuf = NULL; 944 static char *namebuf = NULL;