Skip to content

Commit 4008974

Browse files
dschoGit for Windows Build Agent
authored andcommitted
Merge branch 'address-coverity-reports'
Coverity pointed out a couple of bugs, and here are fixes for some of them. Signed-off-by: Johannes Schindelin <[email protected]>
2 parents ec21aa5 + d48a7f1 commit 4008974

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

builtin/bisect--helper.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -570,7 +570,10 @@ static int bisect_start(struct bisect_terms *terms, int no_checkout,
570570
write_file(git_path_bisect_start(), "%s\n", start_head.buf);
571571

572572
if (no_checkout) {
573-
get_oid(start_head.buf, &oid);
573+
if (get_oid(start_head.buf, &oid) < 0) {
574+
retval = error(_("invalid ref: '%s'"), start_head.buf);
575+
goto finish;
576+
}
574577
if (update_ref(NULL, "BISECT_HEAD", &oid, NULL, 0,
575578
UPDATE_REFS_MSG_ON_ERR)) {
576579
retval = -1;

0 commit comments

Comments
 (0)