summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* 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.
* 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.
| * | | index: fix contradicting comparisonPatrick Steinhardt2016-02-232-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * | | index: plug memory leak in `read_conflict_names`Patrick Steinhardt2016-02-231-4/+14
| | | |
| * | | transports: smart_pkt: fix memory leaks on error pathsPatrick Steinhardt2016-02-231-10/+11
| | | |
| * | | refdb_fs: remove unnecessary check for NULLPatrick Steinhardt2016-02-231-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The fail-label of `reflog_parse` explicitly checks the entry poitner for NULL before freeing it. When we jump to the label the variable has to be set to a non-NULL and valid pointer though: if the allocation fails we immediately return with an error code and if the loop was not entered we return with a success code, withouth executing the label's code. Remove the useless NULL-check to silence Coverity.
| * | | diff_print: assert patch is non-NULLPatrick Steinhardt2016-02-231-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When invoking `diff_print_info_init_frompatch` it is obvious that the patch should be non-NULL. We explicitly check if the variable is set and continue afterwards, happily dereferencing the potential NULL-pointer. Fix this by instead asserting that patch is set. This also silences Coverity.
| * | | pack-objects: return early when computing write order failsPatrick Steinhardt2016-02-231-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The function `compute_write_order` may return a `NULL`-pointer when an error occurs. In such cases we jump to the `done`-label where we try to clean up allocated memory. Unfortunately we try to deallocate the `write_order` array, though, which may be NULL here. Fix this error by returning early instead of jumping to the `done` label. There is no data to be cleaned up anyway.
| * | | pack-objects: check realloc in try_delta with GITERR_CHECK_ALLOCPatrick Steinhardt2016-02-231-2/+4
| | | |
| * | | crlf: do not ignore GIT_PASSTHROUGH errorPatrick Steinhardt2016-02-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When no payload is set for `crlf_apply` we try to compute the crlf attributes ourselves with `crlf_check`. When the function determines that the current file does not require any treatment we return the GIT_PASSTHROUGH error code without actually allocating the out-pointer, which indicates the file should not be passed through the filter. The `crlf_apply` function explicitly checks for the GIT_PASSTHROUGH return code and ignores it. This means we will try to apply the crlf-filter to the current file, leading us to dereference the unallocated payload-pointer. Fix this obviously incorrect behavior by not treating GIT_PASSTHROUGH in any special way. This is the correct thing to do anyway, as the code indicates that the file should not be passed through the filter.
| * | | refspec: check buffer with GITERR_CHECK_ALLOC_BUFPatrick Steinhardt2016-02-231-4/+4
| | | |
| * | | revwalk: use GITERR_CHECK_ALLOC_BUFPatrick Steinhardt2016-02-231-2/+1
| | | |
| * | | smart_pkt: check buffer with GITERR_CHECK_ALLOC_BUFPatrick Steinhardt2016-02-231-1/+3
| | | |
| * | | path: use GITERR_CHECK_ALLOC_BUF to verify passed in bufferPatrick Steinhardt2016-02-231-2/+1
| | | |
| * | | common: introduce GITERR_CHECK_ALLOC_BUFPatrick Steinhardt2016-02-232-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We commonly have to check if a git_buf has been allocated correctly or if we ran out of memory. Introduce a new macro similar to `GITERR_CHECK_ALLOC` which checks if we ran OOM and if so returns an error. Provide a `#nodef` for Coverity to mark the error case as an abort path.
| * | | coverity: hint git_vector_foreach does not deref NULL contentsPatrick Steinhardt2016-02-231-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Coverity does not comprehend the connection between a vector's size and the contents pointer, that is that the vector's pointer is non-NULL when its size is positive. As the vector code should be reasonably well tested and users are expected to not manually modify a vector's contents it seems save to assume that the macros will never dereference a NULL pointer. Fix Coverity warnings by overriding the foreach macros with macros that explicitly aborting when (v)->contents is NULL.
* | | | Merge pull request #3630 from libgit2/cmn/idx-extra-checkEdward Thomson2016-02-251-1/+18
|\ \ \ \ | |_|/ / |/| | | Extra checks for packfile indices
| * | | pack: don't allow a negative offsetcmn/idx-extra-checkCarlos Martín Nieto2016-02-251-0/+5
| | | |
| * | | pack: make sure we don't go out of bounds for extended entriesCarlos Martín Nieto2016-02-251-1/+13
| | | | | | | | | | | | | | | | | | | | | | | | 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.