mirror of
https://github.com/git/git.git
synced 2024-11-28 04:23:30 +08:00
revision: use strtol_i() for exclude_parent
Avoid silent overflow of the int exclude_parent by using the appropriate function, strtol_i(), to parse its value. Signed-off-by: René Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
a0feb8611d
commit
793c21182e
@ -2112,9 +2112,8 @@ static int handle_revision_arg_1(const char *arg_, struct rev_info *revs, int fl
|
||||
int exclude_parent = 1;
|
||||
|
||||
if (mark[2]) {
|
||||
char *end;
|
||||
exclude_parent = strtoul(mark + 2, &end, 10);
|
||||
if (*end != '\0' || !exclude_parent)
|
||||
if (strtol_i(mark + 2, 10, &exclude_parent) ||
|
||||
exclude_parent < 1)
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user