• Show log

    Commit

  • Hash : 7ce231ff
    Author : Patrick Steinhardt
    Date : 2019-11-05T22:44:27

    patch_parse: fix segfault when header path contains whitespace only
    
    When parsing header paths from a patch, we reject any patches with empty
    paths as malformed patches. We perform the check whether a path is empty
    before sanitizing it, though, which may lead to a path becoming empty
    after the check, e.g. if we have trimmed whitespace. This may lead to a
    segfault later when any part of our patching logic actually references
    such a path, which may then be a `NULL` pointer.
    
    Fix the issue by performing the check after sanitizing. Add tests to
    catch the issue as they would have produced a segfault previosuly.
    

  • README.md

  • Writing Clar tests for libgit2

    For information on the Clar testing framework and a detailed introduction please visit:

    https://github.com/vmg/clar

    • Write your modules and tests. Use good, meaningful names.

    • Make sure you actually build the tests by setting:

        cmake -DBUILD_CLAR=ON build/
    • Test:

        ./build/libgit2_clar
    • Make sure everything is fine.

    • Send your pull request. That’s it.