1. 02 May, 2016 5 commits
    • delta-apply: fix sign extension · 153fde5b
      We compute offsets by executing `off |= (*delta++ << 24)` for
      multiple constants, where `off` is of type `size_t` and `delta`
      is of type `unsigned char`. The usual arithmetic conversions (see
      ISO C89 §3.2.1.5 "Usual arithmetic conversions") kick in here,
      causing us to promote both operands to `int` and then extending
      the result to an `unsigned long` when OR'ing it with `off`.
      The integer promotion to `int` may result in wrong size
      calculations for big values.
      
      Fix the issue by making the constants `unsigned long`, causing both
      operands to be promoted to `unsigned long`.
      Patrick Steinhardt committed
    • odb_loose: fix undefined behavior when computing size · 7f407710
      An object's size is computed by reading the object header's size
      field until the most significant bit is not set anymore. To get
      the total size, we increase the shift on each iteration and add
      the shifted value to the total size.
      
      We read the current value into a variable of type `unsigned
      char`, from which we then take all bits except the most
      significant bit and shift the result. We will end up with a
      maximum shift of 60, but this exceeds the width of the value's
      type, resulting in undefined behavior.
      
      Fix the issue by instead reading the values into a variable of
      type `unsigned long`, which matches the required width. This is
      equivalent to git.git, which uses an `unsigned long` as well.
      Patrick Steinhardt committed
    • checkout: set ignorecase=0 when config lookup fails · 7b24c4fd
      When `git_repository__cvar` fails we may end up with a
      `ignorecase` value of `-1`. As we subsequently check if
      `ignorecase` is non-zero, we may end up reporting that data
      should be removed when in fact it should not.
      
      Err on the safer side and set `ignorecase = 0` when
      `git_repository__cvar` fails.
      Patrick Steinhardt committed
    • merge_file: do not unnecessarily check ours/theirs for NULL · fcd1b786
      The `merge_file__xdiff` function checks if either `ours` or
      `theirs` is `NULL`. The function is to be called with existing
      files, though, and in fact already unconditionally dereferences
      both pointers.
      
      Remove the unnecessary check to silence warnings.
      Patrick Steinhardt committed
  2. 29 Apr, 2016 4 commits
  3. 28 Apr, 2016 1 commit
  4. 27 Apr, 2016 1 commit
  5. 26 Apr, 2016 8 commits
  6. 25 Apr, 2016 2 commits
  7. 22 Apr, 2016 2 commits
  8. 21 Apr, 2016 7 commits
  9. 19 Apr, 2016 10 commits