1. 30 May, 2018 9 commits
    • refs: preserve the owning refdb when duping reference · e2a80124
      This fixes a segfault in git_reference_owner on references returned from git_reference__read_head and git_reference_dup ones.
      Etienne Samson committed
    • fixed stack smashing due to wrong size of struct stat on the stack · e9ee7bd0
      on 32-bit systems with 64-bit file descriptor offsets enabled
      (added -D_FILE_OFFSET_BITS=64 when compiling the test suite)
      Andreas Baumann committed
    • attr_file: fix handling of directory patterns with trailing spaces · b260fdc8
      When comparing whether a path matches a directory rule, we pass the
      both the path and directory name to `fnmatch` with
      `GIT_ATTR_FNMATCH_DIRECTORY` being set. `fnmatch` expects the pattern to
      contain no trailing directory '/', which is why we try to always strip
      patterns of trailing slashes. We do not handle that case correctly
      though when the pattern itself has trailing spaces, causing the match to
      fail.
      
      Fix the issue by stripping trailing spaces and tabs for a rule previous
      to checking whether the pattern is a directory pattern with a trailing
      '/'. This replaces the whitespace-stripping in our ignore file parsing
      code, which was stripping whitespaces too late. Add a test to catch
      future breakage.
      Patrick Steinhardt committed
    • transports: local: fix assert when fetching into repo with symrefs · a714e836
      When fetching into a repository which has symbolic references via the
      "local" transport we run into an assert. The assert is being triggered
      while we negotiate the packfile between the two repositories. When
      hiding known revisions from the packbuilder revwalk, we unconditionally
      hide all references of the local refdb. In case one of these references
      is a symbolic reference, though, this means we're trying to hide a
      `NULL` OID, which triggers the assert.
      
      Fix the issue by only hiding OID references from the revwalk. Add a test
      to catch this issue in the future.
      Patrick Steinhardt committed
    • odb: mempack: fix leaking objects when freeing mempacks · 59012bf4
      When a ODB mempack gets free'd, we take no measures at all to free its
      contents, most notably the objects added to the database, resulting in a
      memory leak. Call `git_mempack_reset` previous to freeing the ODB
      structures themselves, which takes care of releasing all associated
      data structures.
      Patrick Steinhardt committed
    • sha1dc: update to fix errors with endianess · 4d4a7dbf
      This updates the version of SHA1DC to c3e1304ea3.
      bgermann committed
    • transports: ssh: replace deprecated function `libssh2_session_startup` · b89988c7
      The function `libssh2_session_startup` has been deprecated since libssh2
      version 1.2.8 in favor of `libssh2_session_handshake` introduced in the
      same version. libssh2 1.2.8 was released in April 2011, so it is already
      seven years old. It is available in Debian Wheezy, Ubuntu Trusty and
      CentOS 7.4, so the most important and conservative distros already have
      it available. As such, it seems safe to just use the new function.
      Patrick Steinhardt committed
    • transports: ssh: disconnect session before freeing it · b2e7d8c2
      The function `ssh_stream_free` takes over the responsibility of closing
      channels and streams just before freeing their memory, but it does not
      do so for the session. In fact, we never disconnect the session
      ourselves at all, as libssh2 will not do so itself upon freeing the
      structure. Quoting the documentation of `libssh2_session_free`:
      
          > Frees all resources associated with a session instance. Typically
          > called after libssh2_session_disconnect_ex,
      
      The missing disconnect probably stems from a misunderstanding what it
      actually does. As we are already closing the TCP socket ourselves, the
      assumption was that no additional disconnect is required. But calling
      `libssh2_session_disconnect` will notify the server that we are cleanly
      closing the connection, such that the server can free his own resources.
      
      Add a call to `libssh2_session_disconnect` to fix that issue.
      
      [1]: https://www.libssh2.org/libssh2_session_free.html
      Patrick Steinhardt committed
  2. 29 May, 2018 23 commits
  3. 23 Mar, 2018 3 commits
  4. 20 Mar, 2018 3 commits
  5. 19 Mar, 2018 2 commits