• Show log

    Commit

  • Hash : 37141ff7
    Author : Patrick Steinhardt
    Date : 2019-10-21T18:56:59

    patch_parse: detect overflow when calculating old/new line position
    
    When the patch contains lines close to INT_MAX, then it may happen that
    we end up with an integer overflow when calculating the line of the
    current diff hunk. Reject such patches as unreasonable to avoid the
    integer overflow.
    
    As the calculation is performed on integers, we introduce two new
    helpers `git__add_int_overflow` and `git__sub_int_overflow` that perform
    the integer overflow check in a generic way.