Commits

Anonymous committed 6ea9385 Merge

Merge branch 'nd/maint-parse-depth' into maint

* nd/maint-parse-depth:
Catch invalid --depth option passed to clone or fetch

  • Participants
  • Parent commits bc0fe84, e7622ce

Comments (0)

Files changed (1)

 	} else if (!strcmp(name, TRANS_OPT_DEPTH)) {
 		if (!value)
 			opts->depth = 0;
-		else
-			opts->depth = atoi(value);
+		else {
+			char *end;
+			opts->depth = strtol(value, &end, 0);
+			if (*end)
+				die("transport: invalid depth option '%s'", value);
+		}
 		return 0;
 	}
 	return 1;