FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Fix leaks, some warnings and an error by ethomson · Pull Request #3865 · libgit2/libgit2 · GitHub

Repository navigation

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .c  (10) .h  (3) .md  (1) All 3 file types selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
7 changes: 7 additions & 0 deletions CHANGELOG.md
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
Expand Up @@ -51,6 +51,13 @@ v0.24 + 1

### Breaking API changes

* `git_packbuilder_object_count` and `git_packbuilder_written` now
return a `size_t` instead of a `uint32_t` for more thorough
compatibility with the rest of the library.

* `git_packbuiler_progress` now provides explicitly sized `uint32_t`
values instead of `unsigned int`.

v0.24
-------

Expand Down
8 changes: 4 additions & 4 deletions include/git2/pack.h
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
Expand Up @@ -196,21 +196,21 @@ GIT_EXTERN(int) git_packbuilder_foreach(git_packbuilder *pb, git_packbuilder_for
* @param pb the packbuilder
* @return the number of objects in the packfile
*/
GIT_EXTERN(uint32_t) git_packbuilder_object_count(git_packbuilder *pb);
GIT_EXTERN(size_t) git_packbuilder_object_count(git_packbuilder *pb);

/**
* Get the number of objects the packbuilder has already written out
*
* @param pb the packbuilder
* @return the number of objects which have already been written
*/
GIT_EXTERN(uint32_t) git_packbuilder_written(git_packbuilder *pb);
GIT_EXTERN(size_t) git_packbuilder_written(git_packbuilder *pb);

/** Packbuilder progress notification function */
typedef int (*git_packbuilder_progress)(
int stage,
unsigned int current,
unsigned int total,
uint32_t current,
uint32_t total,
void *payload);

/**
Expand Down
7 changes: 5 additions & 2 deletions src/apply.c
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
Expand Up @@ -53,7 +53,10 @@ static int patch_image_init_fromstr(
for (start = in; start < in + in_len; start = end) {
end = memchr(start, '\n', in_len);

if (end < in + in_len)
if (end == NULL)
end = in + in_len;

else if (end < in + in_len)
end++;

line = git_pool_mallocz(&out->pool, 1);
Expand Down Expand Up @@ -97,7 +100,7 @@ static bool match_hunk(
git_diff_line *preimage_line = git_vector_get(&preimage->lines, i);
git_diff_line *image_line = git_vector_get(&image->lines, linenum + i);

if (preimage_line->content_len != preimage_line->content_len ||
if (preimage_line->content_len != image_line->content_len ||
memcmp(preimage_line->content, image_line->content, image_line->content_len) != 0) {
match = 0;
break;
Expand Down
1 change: 1 addition & 0 deletions src/crlf.c
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
Expand Up @@ -289,6 +289,7 @@ static int crlf_check(
ca.eol = check_eol(attr_values[1]); /* eol */
}
ca.auto_crlf = GIT_AUTO_CRLF_DEFAULT;
ca.safe_crlf = GIT_SAFE_CRLF_DEFAULT;

/*
* Use the core Git logic to see if we should perform CRLF for this file
Expand Down
4 changes: 2 additions & 2 deletions src/index.c
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
Expand Up @@ -2160,12 +2160,12 @@ static int read_reuc(git_index *index, const char *buffer, size_t size)

if (git__strtol64(&tmp, buffer, &endptr, 8) < 0 ||
!endptr || endptr == buffer || *endptr ||
tmp < 0) {
tmp < 0 || tmp > UINT32_MAX) {
index_entry_reuc_free(lost);
return index_error_invalid("reading reuc entry stage");
}

lost->mode[i] = tmp;
lost->mode[i] = (uint32_t)tmp;

len = (endptr + 1) - buffer;
if (size <= len) {
Expand Down
Loading

Back | FazBrowse Home | New Git URL