forked from git/git
-
Notifications
You must be signed in to change notification settings - Fork 201
Fix issues pointed out in Git for Windows by Coverity after merging v2.56.0-rc0 #2231
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
dscho
wants to merge
7
commits into
gitgitgadget:master
Choose a base branch
from
dscho:fix-coverity-high-severity
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
ef08bba
wrapper: guard writev_in_full() against signed overflow
dscho 3fc7774
gpg-interface: make signature-prefix matching length-aware
dscho 1cf4e5d
midx: validate incremental MIDX pack IDs
dscho bd9e06e
rerere: do not record failed conflict resolution data
dscho bc67ad3
t/unit-tests: check reftable iterator initialization
dscho de28e72
oss-fuzz: handle reftable iterator initialization failures
dscho 60599d2
test-read-midx: check midx_fill_entry() result
dscho File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -476,8 +476,11 @@ static int handle_file(struct index_state *istate, | |
| unlink_or_warn(output); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Junio C Hamano wrote on the Git mailing list (how to reply to this email): "Johannes Schindelin via GitGitGadget" <gitgitgadget@gmail.com>
writes:
> @@ -778,7 +798,9 @@ static void do_rerere_one_path(struct index_state *istate,
> assign_variant(id);
>
> variant = id->variant;
> - handle_file(istate, path, NULL, rerere_path(&buf, id, "preimage"));
> + if (handle_file(istate, path, NULL,
> + rerere_path(&buf, id, "preimage")) < 0)
> + goto out;
> if (id->collection->status[variant] & RR_HAS_POSTIMAGE) {
> const char *path = rerere_path(&buf, id, "postimage");
> if (unlink(path))
Good to see this one, which is the only unchecked call to the
handle_file() function, checked for an error. Looking good.
Thanks. |
||
| return error(_("could not parse conflict hunks in '%s'"), path); | ||
| } | ||
| if (io.io.wrerror) | ||
| if (io.io.wrerror) { | ||
| if (output) | ||
| unlink_or_warn(output); | ||
| return -1; | ||
| } | ||
| return has_conflicts; | ||
| } | ||
|
|
||
|
|
@@ -729,8 +732,25 @@ static void do_rerere_one_path(struct index_state *istate, | |
|
|
||
| /* Has the user resolved it already? */ | ||
| if (variant >= 0) { | ||
| if (!handle_file(istate, path, NULL, NULL)) { | ||
| copy_file(the_repository, rerere_path(&buf, id, "postimage"), path, 0666); | ||
| int ret = handle_file(istate, path, NULL, NULL); | ||
|
|
||
| if (ret < 0) | ||
| goto out; | ||
| if (!ret) { | ||
| const int had_postimage = | ||
| id->collection->status[variant] & RR_HAS_POSTIMAGE; | ||
| const char *postimage = | ||
| rerere_path(&buf, id, "postimage"); | ||
|
|
||
| if (copy_file(the_repository, | ||
| postimage, | ||
| path, 0666)) { | ||
| if (!had_postimage) | ||
| unlink_or_warn(postimage); | ||
| error_errno(_("could not copy resolution for '%s'"), | ||
| path); | ||
| goto out; | ||
| } | ||
| id->collection->status[variant] |= RR_HAS_POSTIMAGE; | ||
| fprintf_ln(stderr, _("Recorded resolution for '%s'."), path); | ||
| free_rerere_id(rr_item); | ||
|
|
@@ -778,7 +798,9 @@ static void do_rerere_one_path(struct index_state *istate, | |
| assign_variant(id); | ||
|
|
||
| variant = id->variant; | ||
| handle_file(istate, path, NULL, rerere_path(&buf, id, "preimage")); | ||
| if (handle_file(istate, path, NULL, | ||
| rerere_path(&buf, id, "preimage")) < 0) | ||
| goto out; | ||
| if (id->collection->status[variant] & RR_HAS_POSTIMAGE) { | ||
| const char *path = rerere_path(&buf, id, "postimage"); | ||
| if (unlink(path)) | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Junio C Hamano wrote on the Git mailing list (how to reply to this email):
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Johannes Schindelin wrote on the Git mailing list (how to reply to this email):
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Junio C Hamano wrote on the Git mailing list (how to reply to this email):