Skip to content

Commit 1cb8ef9

Browse files
committed
rebase -i: watch out for invalid upstream arguments
This was overlooked in 53bbcfb (rebase -i: implement the main part of interactive rebase as a builtin, 2018-09-27). Found by Coverity. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 18dcd5a commit 1cb8ef9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

builtin/rebase--interactive.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ static int get_revision_ranges(const char *upstream, const char *onto,
3333
const char *shortrev;
3434
struct object_id rev_oid;
3535

36-
get_oid(base_rev, &rev_oid);
36+
if (get_oid(base_rev, &rev_oid) < 0)
37+
return error(_("invalid rev '%s'"), base_rev);
3738
shortrev = find_unique_abbrev(&rev_oid, DEFAULT_ABBREV);
3839

3940
*shortrevisions = xstrfmt("%s..%s", shortrev, shorthead);

0 commit comments

Comments
 (0)