Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
a7fbb05
repository: being a worktree means we're not really bare
tiennou Apr 18, 2018
c62c637
worktree: a worktree can be made from a bare repository
tiennou Apr 20, 2018
a051bce
patch_parse: populate line numbers while parsing diffs
tiennou Jun 18, 2018
c37c6ed
tree: accept null ids in existing trees when updating
carlosmn Jul 18, 2018
b884456
tree: rename from_tree to validate and clarify the tree in the test
carlosmn Jul 27, 2018
e129540
parse: Do not initialize the content in context to NULL
neithernut Aug 4, 2018
9023f8f
config_file: Don't crash on options without a section
nelhage Jul 22, 2018
ab3f609
Don't error on missing section, just continue
nelhage Aug 5, 2018
831a709
Add a comment
nelhage Aug 5, 2018
ef52371
Write a test.
nelhage Aug 14, 2018
f4a7652
Fix the test and comment.
nelhage Aug 14, 2018
fad5965
diff: fix OOM on AIX when finding similar deltas in empty diff
pks-t Aug 9, 2018
0fefd89
util: make the qsort_r check work on macOS
tiennou Aug 17, 2018
a5a0347
Fix leak in index.c
abyss7 Aug 16, 2018
ef7d7de
worktree: unlock should return 1 when the worktree isn't locked
tiennou Aug 16, 2018
c0e038a
revwalk: The left operand of '<' is a garbage value
tiennou Aug 20, 2018
01b8bbf
remote: set the error before cleanup
tiennou Aug 20, 2018
54e7cf7
cmake: detect and use libc-provided iconv
pks-t Aug 24, 2018
5fc7d59
index: release the snapshot instead of freeing the index
tiennou Sep 11, 2018
ebb0e37
vector: do not malloc 0-length vectors on dup
tiennou Sep 26, 2018
b133ab9
vector: do not realloc 0-size vectors
tiennou Sep 26, 2018
3cabf8d
revwalk: use the max value for a signed integer
carlosmn Sep 17, 2018
b69089f
revwalk: only check the first commit in the list for an earlier times…
carlosmn Sep 17, 2018
e91d6b5
fix check if blob is uninteresting when inserting tree to packbuilder
palmin Sep 27, 2018
2e7d53a
cmake: enable -Wformat and -Wformat-security
carlosmn Sep 17, 2018
0952278
tests: fix warning for implicit conversion of integer to pointer
pks-t Oct 5, 2018
e78f9f6
cmake: explicitly enable int-conversion warnings
pks-t Oct 5, 2018
4ca4c7d
transport/http: do not return success if we failed to get a scheme
tiennou Aug 21, 2018
a77b64a
ignore unsupported http authentication schemes
palmin Oct 6, 2018
ebdca44
git_remote_prune to be O(n * logn)
marcin-krystianc Sep 2, 2018
80890b9
winhttp: retry erroneously failing requests
ethomson Jul 20, 2018
45d5556
CHANGELOG: update for v0.27.7
pks-t Oct 19, 2018
a0c286b
version: bump to v0.27.7
pks-t Oct 19, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
diff: fix OOM on AIX when finding similar deltas in empty diff
The function `git_diff_find_similar` keeps a function of cache
similarity metrics signatures, whose size depends on the number of
deltas passed in via the `diff` parameter. In case where the diff is
empty and thus doesn't have any deltas at all, we may end up allocating
this cache via a call to `git__calloc(0, sizeof(void *))`. At least on
AIX, allocating 0 bytes will result in a `NULL` pointer being returned,
which causes us to erroneously return an OOM error.

Fix this situation by simply returning early in case where we are being
passed an empty diff, as we cannot find any similarities in that case
anyway.

(cherry picked from commit c65568d)
  • Loading branch information
pks-t committed Oct 26, 2018
commit fad596582152112b2fc935fdf4afe98c2890f713
2 changes: 1 addition & 1 deletion src/diff_tform.c
Original file line number Diff line number Diff line change
Expand Up @@ -822,7 +822,7 @@ int git_diff_find_similar(
num_deltas = diff->deltas.length;

/* TODO: maybe abort if deltas.length > rename_limit ??? */
if (!git__is_uint32(num_deltas))
if (!num_deltas || !git__is_uint32(num_deltas))
goto cleanup;

/* No flags set; nothing to do */
Expand Down