1. 04 Nov, 2018 20 commits
  2. 03 Nov, 2018 2 commits
  3. 31 Oct, 2018 1 commit
  4. 30 Oct, 2018 2 commits
  5. 26 Oct, 2018 6 commits
  6. 25 Oct, 2018 9 commits
    • Merge pull request #4862 from libgit2/ethomson/win_ci · 814389d4
      Windows CI: fail build on test failure
      Edward Thomson committed
    • Merge pull request #4863 from libgit2/ethomson/ci_nightly · cd248c70
      ci: run all the jobs during nightly builds
      Edward Thomson committed
    • ci: run all the jobs during nightly builds · be5a2ae2
      Instead of running the oddball builds, run all the builds (the ones
      that we always run during PR validation and CI) during a nightly
      build for increased coverage.
      Edward Thomson committed
    • ci: fail on test failures · 0e26717a
      PowerShell can _read_ top-level variables in functions, but cannot _update_
      top-level variables in functions unless they're explicitly prefixed with
      `$global`.
      Edward Thomson committed
    • commit: fix reading out of bounds when parsing encoding · 7655b2d8
      The commit message encoding is currently being parsed by the
      `git__prefixcmp` function. As this function does not accept a buffer
      length, it will happily skip over a buffer's end if it is not `NUL`
      terminated.
      
      Fix the issue by using `git__prefixncmp` instead. Add a test that
      verifies that we are unable to parse the encoding field if it's cut off
      by the supplied buffer length.
      Patrick Steinhardt committed
    • tests: add tests that exercise commit parsing · c2e3d8ef
      We currently do not have any test suites dedicated to parsing commits
      from their raw representations. Add one based on `git_object__from_raw`
      to be able to test special cases more easily.
      Patrick Steinhardt committed
    • tag: fix out of bounds read when searching for tag message · ee11d47e
      When parsing tags, we skip all unknown fields that appear before the tag
      message. This skipping is done by using a plain `strstr(buffer, "\n\n")`
      to search for the two newlines that separate tag fields from tag
      message. As it is not possible to supply a buffer length to `strstr`,
      this call may skip over the buffer's end and thus result in an out of
      bounds read. As `strstr` may return a pointer that is out of bounds, the
      following computation of `buffer_end - buffer` will overflow and result
      in an allocation of an invalid length.
      
      Fix the issue by using `git__memmem` instead. Add a test that verifies
      parsing the tag fails not due to the allocation failure but due to the
      tag having no message.
      Patrick Steinhardt committed
    • tests: add tests that exercise tag parsing · 4c738e56
      While the tests in object::tag::read exercises reading and parsing valid
      tags from the ODB, they barely try to verify that the parser fails in a
      sane way when parsing invalid tags. Create a new test suite
      object::tag::parse that directly exercise the parser by using
      `git_object__from_raw` and add various tests for valid and invalid tags.
      Patrick Steinhardt committed
    • util: provide `git__memmem` function · 83e8a6b3
      Unfortunately, neither the `memmem` nor the `strnstr` functions are part
      of any C standard but are merely extensions of C that are implemented by
      e.g. glibc. Thus, there is no standardized way to search for a string in
      a block of memory with a limited size, and using `strstr` is to be
      considered unsafe in case where the buffer has not been sanitized. In
      fact, there are some uses of `strstr` in exactly that unsafe way in our
      codebase.
      
      Provide a new function `git__memmem` that implements the `memmem`
      semantics. That is in a given haystack of `n` bytes, search for the
      occurrence of a byte sequence of `m` bytes and return a pointer to the
      first occurrence. The implementation chosen is the "Not So Naive"
      algorithm from [1]. It was chosen as the implementation is comparably
      simple while still being reasonably efficient in most cases.
      Preprocessing happens in constant time and space, searching has a time
      complexity of O(n*m) with a slightly sub-linear average case.
      
      [1]: http://www-igm.univ-mlv.fr/~lecroq/string/
      Patrick Steinhardt committed