1. 30 Oct, 2019 1 commit
  2. 22 Jan, 2019 1 commit
  3. 17 Jan, 2019 1 commit
  4. 01 Dec, 2018 1 commit
  5. 09 Nov, 2018 1 commit
    • signature: fix out-of-bounds read when parsing timezone offset · 52f859fd
      When parsing a signature's timezone offset, we first check whether there
      is a timezone at all by verifying that there are still bytes left to
      read following the time itself. The check thus looks like `time_end + 1
      < buffer_end`, which is actually correct in this case. After setting the
      timezone's start pointer to that location, we compute the remaining
      bytes by using the formula `buffer_end - tz_start + 1`, re-using the
      previous `time_end + 1`. But this is in fact missing the braces around
      `(tz_start + 1)`, thus leading to an overestimation of the remaining
      bytes by a length of two. In case of a non-NUL terminated buffer, this
      will result in an overflow.
      
      The function `git_signature__parse` is only used in two locations. First
      is `git_signature_from_buffer`, which only accepts a string without a
      length. The string thus necessarily has to be NUL terminated and cannot
      trigger the issue.
      
      The other function is `git_commit__parse_raw`, which can in fact trigger
      the error as it may receive non-NUL terminated commit data. But as
      objects read from the ODB are always NUL-terminated by us as a
      cautionary measure, it cannot trigger the issue either.
      
      In other words, this error does not have any impact on security.
      Patrick Steinhardt committed
  6. 13 Jul, 2018 1 commit
    • treewide: remove use of C++ style comments · 9994cd3f
      C++ style comment ("//") are not specified by the ISO C90 standard and
      thus do not conform to it. While libgit2 aims to conform to C90, we did
      not enforce it until now, which is why quite a lot of these
      non-conforming comments have snuck into our codebase. Do a tree-wide
      conversion of all C++ style comments to the supported C style comments
      to allow us enforcing strict C90 compliance in a later commit.
      Patrick Steinhardt committed
  7. 10 Jun, 2018 1 commit
  8. 12 Nov, 2017 1 commit
    • signature: distinguish +0000 and -0000 UTC offsets · f063dafb
      Git considers '-0000' a valid offset for signature lines.  They need to
      be treated as _not_ equal to a '+0000' signature offset.  Parsing a
      signature line stores the offset in a signed integer which does not
      distinguish between `+0` and `-0`.
      
      This patch adds an additional flag `sign` to the `git_time` in the
      `signature` object which is populated with the sign of the offset.  In
      addition to exposing this information to the user, this information is
      also used to compare signatures.
      
      /cc @pks-t @ethomson
      Henry Kleynhans committed
  9. 04 May, 2016 1 commit
    • Fix initial commit test · 5785ae9b
      `test_commit_commit__create_initial_commit_parent_not_current` was not correctly 
      testing that `HEAD` was not changed. Now we grab the oid that it was pointing to
      before the call to `git_commit_create` and the oid that it's pointing to afterwards
      and compare those.
      John Haley committed
  10. 03 May, 2016 1 commit
  11. 28 Apr, 2016 1 commit
  12. 17 Mar, 2016 1 commit
  13. 15 Mar, 2016 1 commit
  14. 08 Mar, 2016 1 commit
  15. 28 Feb, 2016 2 commits
  16. 16 Feb, 2016 1 commit
  17. 11 Feb, 2016 1 commit
    • commit: don't forget the last header field · 460ae11f
      When we moved the logic to handle the first one, wrong loop logic was
      kept in place which meant we still finished early. But we now notice it
      because we're not reading past the last LF we find.
      
      This was not noticed before as the last field in the tested commit was
      multi-line which does not trigger the early break.
      Carlos Martín Nieto committed
  18. 09 Feb, 2016 2 commits
  19. 17 Dec, 2015 1 commit
  20. 01 Dec, 2015 1 commit
  21. 03 Nov, 2015 1 commit
  22. 21 Oct, 2015 1 commit
  23. 22 Jun, 2015 1 commit
  24. 11 Jun, 2015 1 commit
    • commit: ignore multiple author fields · 65d69fe8
      Some tools create multiple author fields. git is rather lax when parsing
      them, although fsck does complain about them. This means that they exist
      in the wild.
      
      As it's not too taxing to check for them, and there shouldn't be a
      noticeable slowdown when dealing with correct commits, add logic to skip
      over these extra fields when parsing the commit.
      Carlos Martín Nieto committed
  25. 03 Mar, 2015 1 commit
    • Remove the signature from ref-modifying functions · 659cf202
      The signature for the reflog is not something which changes
      dynamically. Almost all uses will be NULL, since we want for the
      repository's default identity to be used, making it noise.
      
      In order to allow for changing the identity, we instead provide
      git_repository_set_ident() and git_repository_ident() which allow a user
      to override the choice of signature.
      Carlos Martín Nieto committed
  26. 10 Sep, 2014 1 commit
  27. 01 Jul, 2014 1 commit
  28. 29 Apr, 2014 1 commit
    • commit: safer commit creation with reference update · 217c029b
      The current version of the commit creation and amend function are unsafe
      to use when passing the update_ref parameter, as they do not check that
      the reference at the moment of update points to what the user expects.
      
      Make sure that we're moving history forward when we ask the library to
      update the reference for us by checking that the first parent of the new
      commit is the current value of the reference. We also make sure that the
      ref we're updating hasn't moved between the read and the write.
      
      Similarly, when amending a commit, make sure that the current tip of the
      branch is the commit we're amending.
      Carlos Martín Nieto committed
  29. 04 Feb, 2014 1 commit
  30. 22 Jan, 2014 1 commit
  31. 15 Jan, 2014 1 commit
  32. 02 Dec, 2013 1 commit
  33. 14 Nov, 2013 1 commit