Commit Graph

9561 Commits

Author SHA1 Message Date
Carlos Martín Nieto
1e8255a39b Bump version to 0.24.0 2016-03-03 20:20:43 +01:00
Carlos Martín Nieto
c21c8f67e8 CHANGELOG: prepre tamplate for release 2016-03-03 20:18:55 +01:00
Carlos Martín Nieto
a7ef27af1c CHANGELOG: add note about WinHTTP cred handling 2016-03-03 20:17:13 +01:00
Carlos Martín Nieto
66a530eb4e Merge pull request #3648 from libgit2/cmn/auth-retry
test: make sure we retry the auth callback on all platforms
2016-03-03 20:11:18 +01:00
Carlos Martín Nieto
ba9bb664f3 tests: create a ctest target for cred_callback 2016-03-03 19:31:02 +01:00
Carlos Martín Nieto
778fb695ed Merge pull request #3646 from pks-t/pks/xdiff-fix-from-upstream
xdiff: fix memleak on error case
2016-03-03 12:14:02 +01:00
Carlos Martín Nieto
a4cba9d453 winhttp: retry authentication
If the caller has provided bad authentication, give them another
apportunity to get it right until they give up. This brings WinHTTP in
line with the other transports.
2016-03-03 11:18:03 +01:00
Carlos Martín Nieto
2520573778 test: make sure we retry the auth callback on all platforms
We were missing this test on Windows, which meant we didn't notice that
we never fixed the single authentication attempt it tries, nor its wrong
return code.

Enable this for the unix platforms as well over HTTP. We previously were
doing it locally but disabled it on OS X due to issues with its sshd not
accepting password authentication.
2016-03-03 11:18:03 +01:00
Carlos Martín Nieto
9b3fc895b7 tests: plug a leak 2016-03-03 11:17:36 +01:00
Edward Thomson
edaffe22a2 Merge pull request #3633 from ethomson/safe_creation
Stricter object dependency checking during creation
2016-03-01 17:16:27 +00:00
Patrick Steinhardt
a4ea7faaad xdiff: fix memleak on error case
Commit 3d1abc5afc fixes a memory leak in the xdiff code. In the
process of upstreaming the fix it was pointed out by Johannes
Schindelin that there is another memory leak present (see [1]).

Fix the second memory leak by applying the upstream fix to our
code base.

[1]: http://thread.gmane.org/gmane.comp.version-control.git/287034
2016-03-01 08:56:23 +01:00
Edward Thomson
dbee683553 Merge pull request #3567 from sba1/few-p_getaddrinfo-fixes
Few p_getaddrinfo fixes
2016-02-28 20:13:24 -05:00
Edward Thomson
09d9968014 rebase: additional tests for completing a rebase 2016-02-28 20:10:44 -05:00
Edward Thomson
f2dddf52c0 turn on strict object validation by default 2016-02-28 18:59:43 -05:00
Edward Thomson
4afe536ba1 tests: use legitimate object ids
Use legitimate (existing) object IDs in tests so that we have the
ability to turn on strict object validation when running tests.
2016-02-28 18:54:56 -05:00
Edward Thomson
98c341496f refs: honor strict object creation 2016-02-28 18:54:39 -05:00
Edward Thomson
3ef01e7727 git_object__is_valid: use odb_read_header
This allows lighter weight validation in `git_object__is_valid` that
does not require reading the entire object.
2016-02-28 18:54:39 -05:00
Edward Thomson
6ddf533afc git_index_add: validate objects in index entries (optionally)
When `GIT_OPT_ENABLE_STRICT_OBJECT_CREATION` is turned on, validate
the index entries given to `git_index_add`.
2016-02-28 18:54:39 -05:00
Carlos Martín Nieto
1a9d7c95a1 Merge pull request #3644 from ethomson/debug_pool
travis ci: enable debug pool for valgrind builds
2016-02-28 19:43:45 +01:00
Edward Thomson
2bbc7d3e56 treebuilder: validate tree entries (optionally)
When `GIT_OPT_ENABLE_STRICT_OBJECT_CREATION` is turned on, validate
the tree and parent ids given to treebuilder insertion.
2016-02-28 12:38:40 -05:00
Edward Thomson
ef63bab306 git_commit: validate tree and parent ids
When `GIT_OPT_ENABLE_STRICT_OBJECT_CREATION` is turned on, validate
the tree and parent ids given to commit creation functions.
2016-02-28 12:38:39 -05:00
Edward Thomson
7565dc6572 git_object__is_valid: simple object validity test 2016-02-28 12:38:39 -05:00
Edward Thomson
22a19f5b57 git_libgit2_opts: introduce GIT_OPT_ENABLE_STRICT_OBJECT_CREATION 2016-02-28 12:38:39 -05:00
Edward Thomson
da03356044 travis ci: enable debug pool for valgrind builds 2016-02-28 11:34:36 -05:00
Edward Thomson
6cc4bac894 Merge pull request #3577 from rossdylan/rossdylan/pooldebug
Add a new build flag to disable the pool allocator
2016-02-28 11:31:10 -05:00
Stjepan Rajko
09db7fd8a6 Expand OpenSSL and libssh2 thread safety documentation 2016-02-26 15:31:24 -07:00
Ross Delinger
93e1664228 Fixed typo in one of the ifndef's in pool.h used to enable/disable debug mode 2016-02-26 12:51:13 -05:00
Carlos Martín Nieto
9f4e7c8490 Merge pull request #3638 from ethomson/nsec
USE_NSECS fixes
2016-02-25 18:42:09 +01:00
Edward Thomson
0d9a7498c5 Merge pull request #3628 from pks-t/pks/coverity-fixes
Coverity fixes
2016-02-25 12:09:49 -05:00
Edward Thomson
fd129f28f1 Merge pull request #3630 from libgit2/cmn/idx-extra-check
Extra checks for packfile indices
2016-02-25 11:59:00 -05:00
Edward Thomson
3d6a42d1e1 nsec: support NDK's crazy nanoseconds
Android NDK does not have a `struct timespec` in its `struct stat`
for nanosecond support, instead it has a single nanosecond member inside
the struct stat itself.  We will use that and use a macro to expand to
the `st_mtim` / `st_mtimespec` definition on other systems (much like
the existing `st_mtime` backcompat definition).
2016-02-25 11:40:48 -05:00
Edward Thomson
a4c55069e3 nsec: update staging test for GIT_USE_NSECS
The index::nsec::staging_maintains_other_nanos test was created to
ensure that when we stage an entry when GIT_USE_NSECS is *unset* that
we truncate the index entry and do not persist the (old, invalid)
nanosec values.  Ensure that when GIT_USE_NSECS is *set* that we do
not do that, and actually write the correct nanosecond values.
2016-02-25 11:40:40 -05:00
Carlos Martín Nieto
6d97beb91f pack: don't allow a negative offset 2016-02-25 15:46:59 +01:00
Carlos Martín Nieto
ea9e00cb5c pack: make sure we don't go out of bounds for extended entries
A corrupt index might have data that tells us to go look past the end of
the file for data. Catch these cases and return an appropriate error
message.
2016-02-25 15:43:17 +01:00
Edward Thomson
9dfe11403a Merge pull request #3637 from libgit2/cmn/conventions
CONVENTIONS: update to include general public API principles
2016-02-25 09:08:23 -05:00
Carlos Martín Nieto
1f8cb02f51 CONVENTIONS: update to include general public API principles 2016-02-25 14:51:00 +01:00
Carlos Martín Nieto
68ad3156a0 openssl: we already had the function, just needed the header 2016-02-24 17:17:57 +01:00
Carlos Martín Nieto
f3d1be7d62 openssl: export the locking function when building without OpenSSL
This got lost duing the move and it lets the users call this function
just in case.
2016-02-24 16:38:22 +01:00
Carlos Martín Nieto
43955927e4 Merge pull request #3631 from ethomson/giterr_fixups
Minor `giterr` fixups
2016-02-23 22:27:36 +01:00
Edward Thomson
cd59e0c0c7 giterr_set_str: remove GITERR_OS documentation
The `giterr_set_str` does not actually honor `GITERR_OS`.  Remove
the documentation that claims that we do.
2016-02-23 13:08:58 -05:00
Edward Thomson
04c3b35f9c map: use giterr_set internally
Use the `giterr_set` function, which actually supports `GITERR_OS`.
The `giterr_set_str` function is exposed for external users and will
not append the operating system's error message.
2016-02-23 13:08:50 -05:00
Patrick Steinhardt
32f0798413 diff_tform: fix potential NULL pointer access
The `normalize_find_opts` function in theory allows for the
incoming diff to have no repository. When the caller does not
pass in diff find options or if the GIT_DIFF_FIND_BY_CONFIG value
is set, though, we try to derive the configuration from the
diff's repository configuration without first verifying that the
repository is actually set to a non-NULL value.

Fix this issue by explicitly checking if the repository is set
and if it is not, fall back to a default value of
GIT_DIFF_FIND_RENAMES.
2016-02-23 12:07:37 +01:00
Patrick Steinhardt
3d1abc5afc xmerge: fix memory leak on error path 2016-02-23 12:07:37 +01:00
Patrick Steinhardt
05bf67b901 openssl_stream: fix NULL pointer dereference 2016-02-23 12:07:37 +01:00
Patrick Steinhardt
2baf854e97 openssl_stream: fix memory leak when creating new stream 2016-02-23 12:07:36 +01:00
Patrick Steinhardt
2afb6fa46d rebase: plug memory leak in rebase_alloc
Convert `rebase_alloc` to use our usual error propagation
patterns, that is accept an out-parameter and return an error
code that is to be checked by the caller. This allows us to use
the GITERR_CHECK_ALLOC macro, which helps static analysis.
2016-02-23 12:07:36 +01:00
Patrick Steinhardt
d0cb11e794 remote: set error code in create_internal
Set the error code when an error occurs in any of the called
functions. This ensures we pass the error up to callers and
actually free the remote when an error occurs.
2016-02-23 12:07:36 +01:00
Patrick Steinhardt
0f1e2d2066 index: fix contradicting comparison
The overflow check in `read_reuc` tries to verify if the
`git__strtol32` parses an integer bigger than UINT_MAX. The `tmp`
variable is casted to an unsigned int for this and then checked
for being greater than UINT_MAX, which obviously can never be
true.

Fix this by instead fixing the `mode` field's size in `struct
git_index_reuc_entry` to `uint32_t`. We can now parse the int
with `git__strtol64`, which can never return a value bigger than
`UINT32_MAX`, and additionally checking if the returned value is
smaller than zero.

We do not need to handle overflows explicitly here, as
`git__strtol64` returns an error when the returned value would
overflow.
2016-02-23 12:07:14 +01:00
Patrick Steinhardt
7808c93797 index: plug memory leak in read_conflict_names 2016-02-23 11:50:23 +01:00
Patrick Steinhardt
003c5e46a8 transports: smart_pkt: fix memory leaks on error paths 2016-02-23 11:50:23 +01:00