Log

Author Commit Date CI Message
Johan Abildskov 4bd2a508 2018-08-20T13:51:28 Update giterr_last API documentation to reflect real behaviour
Johan Abildskov 73e31f6f 2018-08-20T12:08:50 Rephrase wording on giterr_last documentation
Johan Abildskov 3602b573 2018-08-20T10:08:30 Document giterr_last() use only after error. #4772
Edward Thomson 5b0258ad 2018-08-19T23:01:38 Merge pull request #4768 from abyss7/master Fix leak in index.c
Edward Thomson cada553c 2018-08-19T15:54:10 Merge pull request #4754 from libgit2/ethomson/threads threads::diff: use separate git_repository objects
Edward Thomson 2afd0185 2018-08-19T12:57:29 threads::iterator: use separate repository objects Our thread policies state that we cannot re-use the `git_repository` across threads. Our tests cannot deviate from that. Courtesy of Ximin Luo, https://github.com/infinity0: https://github.com/libgit2/libgit2/issues/4753#issuecomment-412247757
Edward Thomson c1ef58ac 2018-08-17T15:17:07 Merge pull request #4766 from pks-t/pks/travis-remove-coverity travis: remove Coverity cron job
abyss7 581d5492 2018-08-16T22:45:43 Fix leak in index.c
Patrick Steinhardt 622e12c1 2018-08-16T10:35:31 Merge pull request #4749 from neithernut/fix-git__linenlen-ub parse: Do not initialize the content in context to NULL
Patrick Steinhardt 43e7bf78 2018-08-16T10:27:49 Merge pull request #4750 from nelhage/nelhage-config-no-section config_file: Don't crash on options without a section
Patrick Steinhardt 6259e29e 2018-08-16T09:36:38 travis: remove Coverity cron job With the recent addition of VSTS to our CI infrastructure, we now have two cron jobs running regular Coverity analysis. It doesn't really make a lot of sense to upload two different analysis on our sources to Corverity, though: - in the worst case, Coverity will be repeatedly confused when different sets of sources get analyzed and uploaded - in the best case, nothing is gained because the sources have already been analyzed via the other job Let's just use a single cron job for Coverity. Considering that VSTS seems to be the more beefy and flexible platform, it is more likely to be our future target CI platform. Thus, we retain its support for Coverity and instead remove it from Travis.
Edward Thomson 227ace0f 2018-08-14T20:32:42 Merge pull request #4764 from tiennou/ci/coverity-only ci: Correct the status code check so Coverity doesn't force-fail Travis
Etienne Samson 351ca661 2018-08-14T21:26:14 ci: Correct the status code check so Coverity doesn't force-fail Travis Otherwise you get something like Emitted 525 C/C++ compilation units (100%) successfully 525 C/C++ compilation units (100%) are ready for analysis The cov-build utility completed successfully. Build successfully submitted. Received error code 200 from Coverity travis_time:end:14cf6373:start=1534254309066933889,finish=1534254728190974302,duration=419124040413 The command "if [ -n "$COVERITY" ]; then ../ci/coverity.sh; fi" exited with 1. travis_time:start:01ed61d4 $ if [ -z "$COVERITY" ]; then ../ci/build.sh && ../ci/test.sh; fi travis_time:end:01ed61d4:start=1534254728197560961,finish=1534254728202711214,duration=5150253 The command "if [ -z "$COVERITY" ]; then ../ci/build.sh && ../ci/test.sh; fi" exited with 0. Done. Your build exited with 1.
Nelson Elhage 6698e056 2018-08-14T04:22:14 Fix the test and comment.
Nelson Elhage f1409500 2018-08-14T03:54:01 Write a test.
Edward Thomson 9913e2df 2018-08-09T09:49:33 Merge pull request #4760 from libgit2/ethomson/ci ci: remove appveyor
Edward Thomson 658b8e8a 2018-08-09T09:39:39 readme: remove appveyor build badge
Edward Thomson e9b2e434 2018-08-09T09:30:36 Merge pull request #4761 from pks-t/pks/aix-diff-oom diff: fix OOM on AIX when finding similar deltas in empty diff
Patrick Steinhardt c65568d8 2018-08-09T12:48:26 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.
Edward Thomson 3ce31df3 2018-08-06T16:33:15 ci: remove appveyor
Edward Thomson 9275d84c 2018-08-06T13:14:08 Merge pull request #4755 from pks-t/pks/travis-coverity-cron travis: do not execute Coverity analysis for all cron jobs
Edward Thomson b093bb56 2018-08-06T13:08:15 Merge pull request #4759 from pks-t/pks/ci-werror ci: enable compilation with "-Werror"
Patrick Steinhardt 9ada072e 2018-08-06T13:31:23 Merge pull request #4758 from pks-t/pks/smart-pkt-oob-read smart_pkt: fix potential OOB-read when processing ng packet
Patrick Steinhardt 90084657 2018-08-06T09:12:48 ci: enable compilation with "-Werror" During the conversion of our CI scripts in bf418f09c (ci: refactor unix ci build/test scripts, 2018-07-14), we accidentally dropped the "-DENABLE_WERROR=ON" switch in our cmake invocation. Re-add it to help us catch compiler warnings early.
Patrick Steinhardt 0fcd0563 2018-08-06T12:00:21 odb: fix use of wrong printf formatters The `git_odb_stream` members `declared_size` and `received_bytes` are both of the type `git_off_t`, which we usually defined to be a 64 bit signed integer. Thus, passing these members to "PRIdZ" formatters is not correct, as they are not guaranteed to accept big enough numbers. Instead, use the "PRId64" formatter, which is able to represent 64 bit signed integers.
Patrick Steinhardt c9ad2506 2018-08-06T07:38:29 Merge pull request #4751 from nelhage/config-double-free Fix a double-free in config parsing
Patrick Steinhardt 0a6c13a2 2018-08-06T07:13:56 travis: do not execute Coverity analysis for all cron jobs The new Travis cron job gets executed daily, but our current configuration will cause each job to execute our Coverity script instead of the default build and testing scripts. This cannot work, as Coverity is heavily rate-limiting its API, so our cron builds are doomed to always fail. What we want to do instead is execute our normal builds, but add an additional Coverity jobs. This can easily be done by adding another Coverity-specific job with a conditional "type = cron", which sets the "COVERITY" environment variable. Instead of checking the build type, we then simply check whether "COVERITY" is set or not.
Nelson Elhage ec76a1aa 2018-08-05T14:37:08 Add a comment
Nelson Elhage 019409be 2018-08-05T14:25:22 Don't error on missing section, just continue
Edward Thomson d1919485 2018-08-05T11:01:14 threads::diff: use separate git_repository objects Our thread policies state that we cannot re-use the `git_repository` across threads. Our tests cannot deviate from that.
Nelson Elhage b8a67eda 2018-07-22T23:47:12 Fix a double-free in config parsing
Nelson Elhage c4d7fa95 2018-07-22T23:31:19 config_file: Don't crash on options without a section
Julian Ganz d1bfe614 2018-08-04T19:30:40 parse: Do not initialize the content in context to NULL String operations in libgit2 are supposed to never receive `NULL`, e.g. they are not `NULL`-save. In the case of `git__linenlen()`, invocation with `NULL` leads to undefined behavior. In a `git_parse_ctx` however, the `content` field used in these operations was initialized to `NULL` if the `git_parse_ctx_init()` was called with `NULL` for `content` or `0` for `content_len`. For the latter case, the initialization function even contained some logic for initializing `content` with `NULL`. This commit mitigates triggering undefined behavior by rewriting the logic. Now `content` is always initialized to a non-null buffer. Instead of a null buffer, an empty string is used for denoting an empty buffer.
Patrick Steinhardt 64138b70 2018-08-03T11:13:10 Merge pull request #4728 from pks-t/pks/fuzzers Fuzzers
Patrick Steinhardt 835d6043 2018-08-03T10:01:59 ci: fix location of fuzzer corpora on VSTS When using VSTS-based builds, we are in a different location than when doing Travis builds. Due to this, the relative path to our fuzzer corpora does not work on VSTS. Fix it by using `${SOURCE_DIR}` instead.
Patrick Steinhardt e38ddc90 2018-07-26T15:41:41 fuzzers: limit maximum pack object count By default, libgit2 allows up to 2^32 objects when downloading a packfile from a remote. For each of these objects, libgit2 will allocate up to two small structs, which in total adds up to quite a lot of memory. As a result, our fuzzers might run out of memory rather quick in case where they receive as input a packfile with such a huge count of objects. Limit the packfile object count to 10M objects. This is sufficiently big to still work with most largish repos (linux.git has around 6M objects as of now), but small enough to not cause the fuzzer to OOM.
Patrick Steinhardt 5db64e2f 2018-07-19T14:52:02 fuzzers: convert download_refs fuzzer to C Convert the "download_refs" fuzzer from C++ to C. Rename the source file to have it be picked up by our build system.
Patrick Steinhardt 730c0edb 2018-07-19T14:21:35 fuzzers: import download_refs fuzzer from oss-fuzz This is a direct copy of the code from google/oss-fuzz, written by Nelson Elhage (@nelhage). Note that due to the ".cc" ending, the file will not yet be picked up by the build system. This is intended, as currently that file is partly written in C++, requiring a conversion to C.
Patrick Steinhardt de53972f 2018-07-20T11:07:47 fuzzers: avoid use of libgit2 internals in packfile_raw The packfile_raw fuzzer is using some internal APIs from libgit2, which makes it hard to compile it as part of the oss-fuzz project. As oss-fuzz requires us to link against the C++ FuzzingEngine library, we cannot use "-DBUILD_FUZZERS=ON" directly but instead have to first compile an object from our fuzzers and then link against the C++ library. Compiling the fuzzer objects thus requires an external invocation of CC, and we certainly don't want to do further black magic by adding libgit2's private source directory to the header include path. To fix the issue, convert the code to not use any internal APIs. Besides some headers which we have to add now, this also requires us to change to the hashing function of the ODB. Note that this will change the hashing result, as we have previously not prepended the object header to the data that is to be hashed. But this shouldn't matter in practice, as we don't care for the hash value anyway.
Patrick Steinhardt 12804c46 2018-07-20T12:24:08 cmake: remove USE_SANITIZER and USE_COVERAGE options Both the USE_SANITIZER and USE_COVERAGE options are convenience options that turn on a set of CFLAGS. Despite our own set of CFLAGS required to build libgit2, we have no real business to mess with them, though, as they can easily be passed in by the user via specifying the CFLAGS environment variable. The reasoning behind not providing them is that as soon as we start adding those for some usecases, users might ask for other sets of CFLAGS catering to their specific need in another usecase. Thus, we do not want to support them here.
Patrick Steinhardt ad0cb297 2018-07-20T12:17:42 cmake: fix the unholy options alignment mess
Patrick Steinhardt bf3382d5 2018-07-19T15:22:18 cmake: remove need to add "-fsanitize=fuzzer" flag for fuzzers Right now, users are being instrucded to add the "-DCMAKE_EXE_LINKER_FLAGS=-fsanitize=fuzzer" flag when they want to build our fuzzers. This is error-prone and user unfriendly. Instead, just add the flag to our fuzzers' build instructions so that it happens automatically. Adjust the README accordingly.
Patrick Steinhardt 186a7ba5 2018-07-19T15:13:40 cmake: error out if required C flags are not supported We do want to notify users compiling our source code early on if they try to use C flags which aren't supported. Add a new macro `AddCFlag`, which results in a fatal error in case the flag is not supported, and use it for our fuzzing flags.
Patrick Steinhardt 07cf8b38 2018-07-20T09:03:10 cmake: use C90 standard for our fuzzing targets Like all our other internal code, we want to force the use of C90 for our fuzzers. Do so by setting the "C_STANDARD" property of our fuzzing targets.
Patrick Steinhardt ad087303 2018-07-20T14:20:07 fuzzers: move readme to docs/fuzzing.md
Patrick Steinhardt 59328ed8 2018-07-19T13:29:46 fuzzers: rename "fuzz" directory to match our style Our layout uses names like "examples" or "tests" which is why the "fuzz" directory doesn't really fit in here. Rename the directory to be called "fuzzers" instead. Furthermore, we rename the fuzzer "fuzz_packfile_raw" to "packfile_raw_fuzzer", which is also in line with the already existing fuzzer at google/oss-fuzz. While at it, rename the "packfile_raw" fuzzer to instead just be called "packfile" fuzzer.
lhchavez 60e610a2 2018-01-04T15:36:22 fuzzers: add build support and instructions This change adds support for building a fuzz target for exercising the packfile parser, as well as documentation. It also runs the fuzzers in Travis to avoid regressions.
Edward Thomson 0cf75467 2018-08-02T21:01:10 Merge pull request #4746 from libgit2/ethomson/ci ci: run VSTS builds on master and maint branches
Edward Thomson cd788314 2018-08-02T20:43:21 ci: run VSTS builds on master and maint branches
Edward Thomson ba55592f 2018-08-02T20:34:56 Merge pull request #4743 from Agent00Log/dev/winbugfixes Windows: default credentials / fallback credential handling
Edward Thomson 209c3fe1 2018-08-02T16:42:59 Merge pull request #4745 from libgit2/ethomson/vsts-build-badge ci: add VSTS build badge to README
Edward Thomson a1ae41b8 2018-08-02T14:57:54 ci: add VSTS build badge to README
Edward Thomson 7bed2f34 2018-08-02T15:53:42 Merge pull request #4744 from libgit2/ethomson/travis ci: set PKG_CONFIG_PATH for travis
Edward Thomson abf53363 2018-08-02T14:47:03 ci: set PKG_CONFIG_PATH on travis Homebrew's formula for openssl is "keg-only", which means it does not install it into /usr/local. On macOS builds, we need to set PKG_CONFIG_PATH to include it.
Edward Thomson 5d0070e1 2018-08-02T14:23:23 Merge pull request #4723 from libgit2/ethomson/ci CI: Refactor and introduce VSTS builds
Henning Schaffaf ccbffbae 2018-07-30T13:39:21 Only unitialize if the call to CoInitializeEx was successful
Edward Thomson 4ad108d1 2018-07-30T10:32:01 Merge pull request #4742 from neithernut/revwalk-remove_tautological_condition revwalk: remove tautologic condition for hiding a commit
Edward Thomson d076db11 2018-07-29T17:26:44 ci: run coverity from a nightly VSTS build
Edward Thomson 6b92368c 2018-07-28T22:29:53 ci: run coverity from travis's cron Instead of trying to run coverity builds during the regular PR process, run them during a regularly scheduled cron process. These only need to run nightly, so it makes sense to bring them out of the PR process.
Julian Ganz a4ffbae4 2018-07-29T11:46:05 revwalk: remove tautologic condition for hiding a commit The contition cannot be reached with `commit->uninteresting` being true: either a `break` or a `continue` statement will be hit in this case.
Edward Thomson 24d17562 2018-07-27T16:40:44 ci: remove unused old ci scripts
Edward Thomson 24b8dd82 2018-07-27T12:31:32 ci: move travis to the new scripts
Edward Thomson b00a09b0 2018-07-27T20:14:27 Merge pull request #4731 from libgit2/ethomson/wintls_fix winhttp: retry erroneously failing requests
Edward Thomson 465f8b51 2018-07-26T15:14:37 ci: move appveyor to new scripts
Edward Thomson f7bb4ff8 2018-07-26T15:06:01 ci: use a single setup script for mingw
Edward Thomson 6fb63c92 2018-07-26T14:29:41 ci: use docker containers from libgit2 account
Edward Thomson dc6e80e2 2018-07-26T14:04:19 ci: perform clang builds on Linux
Edward Thomson 6eb97b6b 2018-07-25T01:04:55 ci: dissociate test from leaks process The leaks process is not good about handling children. Ensure that its child is `nohup`ed so that the grandparent shell won't wait for it to exit.
Edward Thomson 230eeda8 2018-07-21T10:49:23 ci: some additional debugging
Edward Thomson b00672b9 2018-07-20T19:47:40 ci: enable leak checking on osx
Edward Thomson afecd15c 2018-07-20T18:09:38 ci: msvc leak-checking
Edward Thomson 7f12c123 2018-07-20T17:20:15 ci: xcode leaks leak-checking
Edward Thomson 219512e7 2018-07-20T14:14:16 buf tests: allocate a smaller size for the oom On Linux (where we run valgrind) allocate a smaller buffer, but still an insanely large size. This will cause malloc to fail but will not cause valgrind to report a likely error with a negative-sized malloc. Keep the original buffer size on non-Linux platforms: this is well-tested on them and changing it may be problematic. On macOS, for example, using the new size causes `malloc` to print a warning to stderr.
Edward Thomson 6d6700d2 2018-07-20T19:01:55 ci: valgrind leak-checking
Edward Thomson 67f5304f 2018-07-14T12:42:50 ci: introduce vsts builds
Patrick Steinhardt 42f83840 2018-07-26T15:25:44 Merge pull request #4721 from nelhage/max-objects Add a configurable limit to the max pack size that will be indexed
Edward Thomson 9e588060 2018-07-14T13:03:16 ci: scripts to setup mingw build environment
Edward Thomson 87342404 2018-07-14T12:35:02 ci: set up a macos host Script to set up dependencies on a macOS build system.
Edward Thomson 5bb2087b 2018-07-14T12:34:05 ci: setup a linux host Sets up a linux host to prepare for a build.
Edward Thomson 451b0017 2018-07-14T12:25:32 ci: improved flexibility for citest.sh Refactor citest.sh to enable local testing by developers.
Edward Thomson bf418f09 2018-07-14T12:24:40 ci: refactor unix ci build/test scripts
Edward Thomson e2cc5b6d 2018-07-14T12:22:47 ci: move tests into citest.ps1 Add citest.ps1 PowerShell script to run the tests.
Edward Thomson 3b6281fa 2018-07-14T12:22:16 ci: Windows PowerShell build script
Edward Thomson ce798b25 2018-07-04T10:56:56 tests: simplify cmake test configuration Simplify the names for the tests, removing the unnecessary "libgit2-clar" prefix. Make "all" the new default test run, and include the online tests by default (since HTTPS should always be enabled). For the CI tests, create an offline-only test, then the various online tests.
Edward Thomson 7d3930a1 2018-07-26T11:15:23 Merge pull request #4739 from pks-t/pks/mbedtls-unused-variable mbedtls: remove unused variable "cacert"
Patrick Steinhardt d4198d4d 2018-07-26T12:11:34 mbedtls: remove unused variable "cacert" In commit 382ed1e87 (mbedtls: load default CA certificates, 2018-03-29), the function `git_mbedtls_stream_global_init` was refactored to call out to `git_mbedtls__set_cert_location` instead of setting up the certificates itself. The conversion forgot to remove the now-unused "cacert" variable, which is now only getting declared to be free'd at the end of the function. Remove it.
Henning Schaffaf 8c21cb5c 2018-07-26T09:52:32 Fix fallback credentials: The call to CoInitializeEx fails if it was previously been set to a different mode.
Henning Schaffaf c9dc30ff 2018-07-26T09:52:21 Fix default credentials: The WinHttpSetCredentials auth scheme must only be one of the supported schemes.
Edward Thomson 45a78977 2018-07-23T12:38:40 Merge pull request #4732 from libgit2/ethomson/leaks Squash some leaks
Edward Thomson 2fabb622 2018-07-21T01:36:46 mbedtls: free stream on shutdown
Edward Thomson 9e002cd5 2018-07-21T01:11:58 mbedtls: make ciphers_list a static array Instead of allocating the ciphers_list, make it a static array. This prevents us from leaking it or having to manage its memory.
Edward Thomson 4e62d26f 2018-07-21T00:45:24 mbedtls: free ciphers_list
Edward Thomson defa9709 2018-07-21T00:41:38 mbedtls: check allocations
Edward Thomson d285de73 2018-07-20T21:52:24 push tests: deeply free the specs Don't just free the spec vector, also free the specs themselves.
Edward Thomson dad99881 2018-07-20T21:51:36 push tests: deeply free the push status Don't just free the push status structure, actually free the strings that were strdup'd into the struct as well.
Edward Thomson ca2eb460 2018-07-20T21:50:58 smart subtransport: free url when resetting stream Free the url field when resetting the stream to avoid leaking it.
Nelson Elhage 32810348 2018-07-20T08:43:54 Use UINT32_MAX as the default object limit This replicates the old behavior of limiting to 2³² by default.
Edward Thomson dc371e3c 2018-07-20T08:20:48 winhttp: retry erroneously failing requests Early Windows TLS 1.2 implementations have an issue during key exchange with OpenSSL implementations that cause negotiation to fail with the error "the buffer supplied to a function was too small." This is a transient error on the connection, so when that error is received, retry up to 5 times to create a connection to the remote server before actually giving up.
Patrick Steinhardt ea9e2c1a 2018-07-20T13:06:56 Merge pull request #4692 from tiennou/examples/checkout Add a checkout example
Patrick Steinhardt 0652abaa 2018-07-20T12:56:49 Merge pull request #4702 from tiennou/fix/coverity Assorted Coverity fixes