diff options
| author | Junio C Hamano <gitster@pobox.com> | 2026-03-27 11:00:02 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2026-03-27 11:00:02 -0700 |
| commit | cb77c3a6a7f508776c5bdd874ee650ceb28dc1ba (patch) | |
| tree | 93dc52ba10193b8e8809271aa2d2b5b10bee928f /apply.c | |
| parent | f23054409b4050900a56bd69467a60866a525d5c (diff) | |
| parent | d05d84c5f507e8b973982e9cf3a27a07cd94fcb8 (diff) | |
| download | git-cb77c3a6a7f508776c5bdd874ee650ceb28dc1ba.tar.xz | |
Merge branch 'mf/apply-p-no-atoi'
"git apply -p<n>" parses <n> more carefully now.
* mf/apply-p-no-atoi:
apply.c: fix -p argument parsing
Diffstat (limited to 'apply.c')
| -rw-r--r-- | apply.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -4981,7 +4981,8 @@ static int apply_option_parse_p(const struct option *opt, BUG_ON_OPT_NEG(unset); - state->p_value = atoi(arg); + if (strtol_i(arg, 10, &state->p_value) < 0 || state->p_value < 0) + die(_("option -p expects a non-negative integer, got '%s'"), arg); state->p_value_known = 1; return 0; } |
