Skip to content

Commit 3d4d151

Browse files
committed
sequencer: check return value of get_oid()
Just a little defensive coding. Found by Coverity. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 83bf505 commit 3d4d151

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

sequencer.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4883,7 +4883,8 @@ int complete_action(struct repository *r, struct replay_opts *opts, unsigned fla
48834883
struct object_id oid;
48844884
struct stat st;
48854885

4886-
get_oid(onto, &oid);
4886+
if (get_oid(onto, &oid) < 0)
4887+
return error(_("invalid rev: '%s'"), onto);
48874888
shortonto = find_unique_abbrev(&oid, DEFAULT_ABBREV);
48884889

48894890
if (!lstat(todo_file, &st) && st.st_size == 0 &&

0 commit comments

Comments
 (0)