summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* smart_pkt: treat empty packet lines as errorbindings/libgit2sharp/022_1Patrick Steinhardt2017-01-091-4/+5
| | | | | | | | | | | | | The Git protocol does not specify what should happen in the case of an empty packet line (that is a packet line "0004"). We currently indicate success, but do not return a packet in the case where we hit an empty line. The smart protocol was not prepared to handle such packets in all cases, though, resulting in a `NULL` pointer dereference. Fix the issue by returning an error instead. As such kind of packets is not even specified by upstream, this is the right thing to do.
* smart_pkt: verify packet length exceeds PKT_LEN_SIZEPatrick Steinhardt2017-01-091-0/+8
| | | | | | | | | | | | | | Each packet line in the Git protocol is prefixed by a four-byte length of how much data will follow, which we parse in `git_pkt_parse_line`. The transmitted length can either be equal to zero in case of a flush packet or has to be at least of length four, as it also includes the encoded length itself. Not checking this may result in a buffer overflow as we directly pass the length to functions which accept a `size_t` length as parameter. Fix the issue by verifying that non-flush packets have at least a length of `PKT_LEN_SIZE`.
* http: perform 'badssl' check also via certificate callbackCarlos Martín Nieto2017-01-091-0/+37
| | | | | | Make sure that the callbacks do also get a 'valid' value of zero when the certificate we're looking at is in valid and assert that within the test.
* http: check certificate validity before clobbering the error variableEtienne Samson2017-01-091-2/+1
|
* Merge pull request #3653 from libgit2/cmn/treebuilder-submodulev0.24.0Edward Thomson2016-03-042-1/+14
|\ | | | | treebuilder: don't try to verify submodules exist in the odb
| * treebuilder: don't try to verify submodules exist in the odbcmn/treebuilder-submoduleCarlos Martín Nieto2016-03-042-1/+14
|/ | | | | | | | Submodules don't exist in the objectdb and the code is making us try to look for a blob with its commit id, which is obviously not going to work. Skip the test if the user wants to insert a submodule.
* Merge pull request #3651 from libgit2/cmn/init-libssh2Edward Thomson2016-03-033-1/+31
|\ | | | | ssh: initialize libssh2
| * ssh: initialize libssh2cmn/init-libssh2Carlos Martín Nieto2016-03-033-1/+31
|/ | | | | | | We should have been doing this, but it initializes itself upon first use, which works as long as nobody's doing concurrent network operations. Initialize it on our init to make sure it's not getting initialized concurrently.
* Merge pull request #3639 from srajko/threading-openssl-libssh2Carlos Martín Nieto2016-03-031-5/+11
|\ | | | | Expand OpenSSL and libssh2 thread safety documentation
| * Expand OpenSSL and libssh2 thread safety documentationStjepan Rajko2016-02-261-5/+11
| |
* | tests: take the version from our defineCarlos Martín Nieto2016-03-031-1/+1
| |
* | Bump version to 0.24.0Carlos Martín Nieto2016-03-031-3/+3
| |
* | CHANGELOG: prepre tamplate for releaseCarlos Martín Nieto2016-03-031-1/+14
| |
* | CHANGELOG: add note about WinHTTP cred handlingCarlos Martín Nieto2016-03-031-0/+3
| |
* | Merge pull request #3648 from libgit2/cmn/auth-retryCarlos Martín Nieto2016-03-034-4/+17
|\ \ | | | | | | test: make sure we retry the auth callback on all platforms
| * | tests: create a ctest target for cred_callbackcmn/auth-retryCarlos Martín Nieto2016-03-033-4/+8
| | |
| * | winhttp: retry authenticationCarlos Martín Nieto2016-03-031-2/+3
| | | | | | | | | | | | | | | | | | 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.
| * | test: make sure we retry the auth callback on all platformsCarlos Martín Nieto2016-03-032-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | Merge pull request #3646 from pks-t/pks/xdiff-fix-from-upstreamCarlos Martín Nieto2016-03-031-2/+5
|\ \ \ | |/ / |/| | xdiff: fix memleak on error case
| * | xdiff: fix memleak on error casePatrick Steinhardt2016-03-011-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 3d1abc5afce 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
* | | tests: plug a leakCarlos Martín Nieto2016-03-031-0/+1
| | |
* | | Merge pull request #3633 from ethomson/safe_creationEdward Thomson2016-03-0124-75/+468
|\ \ \ | |/ / |/| | Stricter object dependency checking during creation
| * | turn on strict object validation by defaultEdward Thomson2016-02-285-29/+34
| | |
| * | tests: use legitimate object idsEdward Thomson2016-02-2812-44/+57
| | | | | | | | | | | | | | | Use legitimate (existing) object IDs in tests so that we have the ability to turn on strict object validation when running tests.
| * | refs: honor strict object creationEdward Thomson2016-02-282-9/+25
| | |
| * | git_object__is_valid: use `odb_read_header`Edward Thomson2016-02-282-15/+28
| | | | | | | | | | | | | | | This allows lighter weight validation in `git_object__is_valid` that does not require reading the entire object.
| * | git_index_add: validate objects in index entries (optionally)Edward Thomson2016-02-283-6/+120
| | | | | | | | | | | | | | | When `GIT_OPT_ENABLE_STRICT_OBJECT_CREATION` is turned on, validate the index entries given to `git_index_add`.
| * | treebuilder: validate tree entries (optionally)Edward Thomson2016-02-282-0/+70
| | | | | | | | | | | | | | | When `GIT_OPT_ENABLE_STRICT_OBJECT_CREATION` is turned on, validate the tree and parent ids given to treebuilder insertion.
| * | git_commit: validate tree and parent idsEdward Thomson2016-02-282-16/+143
| | | | | | | | | | | | | | | When `GIT_OPT_ENABLE_STRICT_OBJECT_CREATION` is turned on, validate the tree and parent ids given to commit creation functions.
| * | git_object__is_valid: simple object validity testEdward Thomson2016-02-281-0/+16
| | |
| * | git_libgit2_opts: introduce `GIT_OPT_ENABLE_STRICT_OBJECT_CREATION`Edward Thomson2016-02-284-0/+19
| | |
* | | Merge pull request #3567 from sba1/few-p_getaddrinfo-fixesEdward Thomson2016-02-281-2/+5
|\ \ \ | | | | | | | | Few p_getaddrinfo fixes
| * | | Copy into the correct destination.Sebastian Bauer2015-12-311-1/+1
| | | |
| * | | Bail out early when no memory is available.Sebastian Bauer2015-12-311-1/+4
| | | |
* | | | Merge pull request #3644 from ethomson/debug_poolCarlos Martín Nieto2016-02-281-2/+2
|\ \ \ \ | |_|/ / |/| | | travis ci: enable debug pool for valgrind builds
| * | | travis ci: enable debug pool for valgrind buildsEdward Thomson2016-02-281-2/+2
| | | |
* | | | Merge pull request #3577 from rossdylan/rossdylan/pooldebugEdward Thomson2016-02-284-30/+117
|\ \ \ \ | |/ / / | | | / | |_|/ |/| | Add a new build flag to disable the pool allocator
| * | Fixed typo in one of the ifndef's in pool.h used to enable/disable debug modeRoss Delinger2016-02-261-1/+1
| | |
| * | Remove unnecessary ifdef in pool.hRoss Delinger2016-02-191-3/+0
| | |
| * | Add a new build flag to disable the pool allocator and pass all ↵Ross Delinger2016-01-124-30/+120
| |/ | | | | | | git_pool_malloc calls straight to git__malloc
* | Merge pull request #3638 from ethomson/nsecCarlos Martín Nieto2016-02-256-20/+51
|\ \ | | | | | | USE_NSECS fixes
| * | nsec: support NDK's crazy nanosecondsEdward Thomson2016-02-255-20/+42
| | | | | | | | | | | | | | | | | | | | | | | | 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).
| * | nsec: update staging test for GIT_USE_NSECSEdward Thomson2016-02-251-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | Merge pull request #3628 from pks-t/pks/coverity-fixesEdward Thomson2016-02-2517-62/+107
|\ \ \ | | | | | | | | Coverity fixes
| * | | diff_tform: fix potential NULL pointer accessPatrick Steinhardt2016-02-231-11/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * | | xmerge: fix memory leak on error pathPatrick Steinhardt2016-02-231-0/+2
| | | |
| * | | openssl_stream: fix NULL pointer dereferencePatrick Steinhardt2016-02-231-0/+2
| | | |
| * | | openssl_stream: fix memory leak when creating new streamPatrick Steinhardt2016-02-231-2/+10
| | | |
| * | | rebase: plug memory leak in `rebase_alloc`Patrick Steinhardt2016-02-231-10/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * | | remote: set error code in `create_internal`Patrick Steinhardt2016-02-231-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | 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.