1. 13 Jul, 2018 3 commits
    • cmake: distinguish internal and system include directories · c13e56f9
      While we want to enforce strict C90 mode, this may cause issues with
      system provided header files which are themselves not strictly
      conforming. E.g. if a system header has C++ style comments, a compiler
      in strict C90 mode would produce an error and abort the build. As the
      user most likely doesn't want to change the system header, this would
      completely break the build on such systems. One example of this is
      mbedtls, which provides such header files.
      
      The problem can be worked around by distinguishing between
      system-provided and project-provided include directories. When adding
      include directories via "-isystem" instead of "-I", the compiler will
      skip certain checks and print out less warnings. To use system includes,
      we can simply add the "SYSTEM" flag to CMake's `INCLUDE_DIRECTORIES` and
      `TARGET_INCLUDE_DIRECTORIES` functions. Note that we have to split the
      include directories into two variables because of this, as we definitely
      still want to check for all warnings produced by our own header files.
      Patrick Steinhardt committed
    • 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
    • treewide: avoid use of `inline` attribute · f347a441
      ISO C90 does not specify the `inline` attribute, and as such we cannot
      use it in our code. While we already use `__inline` when building in
      Microsoft Visual Studio, we should also be using the `__inline__`
      attribute from GCC/Clang. Otherwise, if we're using neither MSVC nor
      GCC/Clang, we should simply avoid using `inline` at all and just define
      functions as static.
      
      This commit adjusts our own `GIT_INLINE` macro as well as the inline
      macros specified by khash and xdiff. This allows us to enable strict C90
      mode in a later commit.
      Patrick Steinhardt committed
  2. 09 Jul, 2018 1 commit
  3. 08 Jul, 2018 1 commit
  4. 06 Jul, 2018 4 commits
  5. 05 Jul, 2018 1 commit
    • delta: fix overflow when computing limit · e087c0de
      When checking whether a delta base offset and length fit into the base
      we have in memory already, we can trigger an overflow which breaks the
      check. This would subsequently result in us reading memory from out of
      bounds of the base.
      
      The issue is easily fixed by checking for overflow when adding `off` and
      `len`, thus guaranteeting that we are never indexing beyond `base_len`.
      This corresponds to the git patch 8960844a7 (check patch_delta bounds
      more carefully, 2006-04-07), which adds these overflow checks.
      
      Reported-by: Riccardo Schirone <rschiron@redhat.com>
      Patrick Steinhardt committed
  6. 30 Jun, 2018 1 commit
  7. 29 Jun, 2018 23 commits
  8. 27 Jun, 2018 3 commits
  9. 26 Jun, 2018 3 commits