1. 24 Jan, 2020 1 commit
  2. 23 Aug, 2019 1 commit
  3. 21 Aug, 2019 1 commit
    • smart: use push_glob instead of manual filtering · 39d18fe6
      The code worked under the assumption that anything under `refs/tags` are
      tag objects, and all the rest would be peelable to a commit. As it is
      completely valid to have tags to blobs under a non `refs/tags` ref, this
      would cause failures when trying to peel a tag to a commit.
      
      Fix the broken filtering by switching to `git_revwalk_push_glob`, which
      already handles this case.
      Etienne Samson committed
  4. 24 Jun, 2019 1 commit
  5. 15 Jun, 2019 1 commit
  6. 22 Feb, 2019 2 commits
  7. 22 Jan, 2019 1 commit
  8. 17 Jan, 2019 1 commit
  9. 03 Oct, 2018 1 commit
  10. 06 Jul, 2018 1 commit
  11. 29 Jun, 2018 2 commits
  12. 26 Jun, 2018 1 commit
  13. 25 Jun, 2018 3 commits
  14. 24 Jun, 2018 1 commit
  15. 10 Jun, 2018 1 commit
  16. 11 Apr, 2018 4 commits
  17. 09 Oct, 2017 1 commit
    • transports: smart: fix memory leak when skipping symbolic refs · 7cb705cb
      When we setup the revision walk for negotiating references with a
      remote, we iterate over all references, ignoring tags and symbolic
      references. While skipping over symbolic references, we forget to free
      the looked up reference, resulting in a memory leak when the next
      iteration simply overwrites the variable.
      
      Fix that issue by freeing the reference at the beginning of each
      iteration and collapsing return paths for error and success.
      Patrick Steinhardt committed
  18. 03 Jul, 2017 1 commit
    • Make sure to always include "common.h" first · 0c7f49dd
      Next to including several files, our "common.h" header also declares
      various macros which are then used throughout the project. As such, we
      have to make sure to always include this file first in all
      implementation files. Otherwise, we might encounter problems or even
      silent behavioural differences due to macros or defines not being
      defined as they should be. So in fact, our header and implementation
      files should make sure to always include "common.h" first.
      
      This commit does so by establishing a common include pattern. Header
      files inside of "src" will now always include "common.h" as its first
      other file, separated by a newline from all the other includes to make
      it stand out as special. There are two cases for the implementation
      files. If they do have a matching header file, they will always include
      this one first, leading to "common.h" being transitively included as
      first file. If they do not have a matching header file, they instead
      include "common.h" as first file themselves.
      
      This fixes the outlined problems and will become our standard practice
      for header and source files inside of the "src/" from now on.
      Patrick Steinhardt committed
  19. 10 Jun, 2017 1 commit
    • smart_protocol: fix parsing of server ACK responses · e141f079
      Fix ACK parsing in wait_while_ack() internal function. This patch
      handles the case where multi_ack_detailed mode sends 'ready' ACKs. The
      existing functionality would bail out too early, thus causing the
      processing of the ensuing packfile to fail if/when 'ready' ACKs were
      sent.
      Roger Gee committed
  20. 10 Feb, 2017 1 commit
  21. 06 Jan, 2017 1 commit
    • smart_pkt: treat empty packet lines as error · 2fdef641
      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.
      Patrick Steinhardt committed
  22. 29 Dec, 2016 1 commit
  23. 12 Dec, 2016 2 commits
  24. 02 Nov, 2016 2 commits
    • transports: smart: abort receiving packets on end of stream · 62494bf2
      When trying to receive packets from the remote, we loop until
      either an error distinct to `GIT_EBUFS` occurs or until we
      successfully parsed the packet. This does not honor the case
      where we are looping over an already closed socket which has no
      more data, leaving us in an infinite loop if we got a bogus
      packet size or if the remote hang up.
      
      Fix the issue by returning `GIT_EEOF` when we cannot read data
      from the socket anymore.
      Patrick Steinhardt committed
    • transports: smart: abort ref announcement on early end of stream · 61530c49
      When reading a server's reference announcements via the smart
      protocol, we expect the server to send multiple flushes before
      the protocol is finished. If we fail to receive new data from the
      socket, we will only return an end of stream error if we have not
      seen any flush yet.
      
      This logic is flawed in that we may run into an infinite loop
      when receiving a server's reference announcement with a bogus
      flush packet. E.g. assume the last flushing package is changed to
      not be '0000' but instead any other value. In this case, we will
      still await one more flush package and ignore the fact that we
      are not receiving any data from the socket, causing an infinite
      loop.
      
      Fix the issue by always returning `GIT_EEOF` if the socket
      indicates an end of stream.
      Patrick Steinhardt committed
  25. 07 Jun, 2016 1 commit
    • transports: smart: fix potential invalid memory dereferences · 7d02019a
      When we receive a packet of exactly four bytes encoding its
      length as those four bytes it can be treated as an empty line.
      While it is not really specified how those empty lines should be
      treated, we currently ignore them and do not return an error when
      trying to parse it but simply advance the data pointer.
      
      Callers invoking `git_pkt_parse_line` are currently not prepared
      to handle this case as they do not explicitly check this case.
      While they could always reset the passed out-pointer to `NULL`
      before calling `git_pkt_parse_line` and determine if the pointer
      has been set afterwards, it makes more sense to update
      `git_pkt_parse_line` to set the out-pointer to `NULL` itself when
      it encounters such an empty packet. Like this it is guaranteed
      that there will be no invalid memory references to free'd
      pointers.
      
      As such, the issue has been fixed such that `git_pkt_parse_line`
      always sets the packet out pointer to `NULL` when an empty packet
      has been received and callers check for this condition, skipping
      such packets.
      Patrick Steinhardt committed
  26. 08 Mar, 2016 1 commit
  27. 18 Feb, 2016 1 commit
  28. 12 Jan, 2016 1 commit
  29. 14 Aug, 2015 1 commit
  30. 20 May, 2015 1 commit
  31. 14 May, 2015 1 commit