summaryrefslogtreecommitdiff
path: root/fuzzers
Commit message (Collapse)AuthorAgeFilesLines
* object: lookup sha256 objectsEdward Thomson2023-02-122-2/+9
| | | | | This is much of the plumbing for the object database to support SHA256, and for objects to be able to parse SHA256 versions of themselves.
* sha256: indirection for experimental functionsEdward Thomson2022-07-131-0/+17
| | | | | The experimental function signature is only available when `GIT_EXPERIMENTAL_SHA256` is enabled.
* odb: add git_odb_optionsEdward Thomson2022-06-201-1/+1
| | | | | Users will need to be able to specify the object id type for the given object database; add a new `git_odb_options` with that option.
* odb_hash*: accept the oid type to hash intoEdward Thomson2022-06-201-1/+1
| | | | | The git_odb_hash helper functions should not assume SHA1, and instead should be given the oid type that they're producing.
* oid: give oids a typeEdward Thomson2022-06-202-2/+2
| | | | | `git_oid`s now have a type, and we require the oid type when creating the object id from creation functions.
* oid: `GIT_OID_*SZ` is now `GIT_OID_SHA1_*SIZE`Edward Thomson2022-06-143-5/+5
| | | | | In preparation for SHA256 support, `GIT_OID_RAWSZ` and `GIT_OID_HEXSZ` need to indicate that they're the size of _SHA1_ OIDs.
* fuzzer: use raw oid dataEdward Thomson2022-04-101-1/+1
| | | | The indexer expects raw oid data, provide it.
* [midx] Fix an undefined behavior (left-shift signed overflow)lhchavez2022-04-051-0/+0
| | | | | | | | | | | | | There was a missing check to ensure that the `off64_t` (which is a signed value) didn't overflow when parsing it from the midx file. This shouldn't have huge repercusions since the parsed value is immediately validated afterwards, but then again, there is no such thing as "benign" undefined behavior. This change makes all the bitwise arithmetic happen with unsigned types and is only casted to `off64_t` until the very end. Thanks to Taotao Gu for finding and reporting this!
* cmake: document CMakeLists.txt hierarchyEdward Thomson2022-02-221-0/+2
|
* packbuilder: use the packfile name instead of hashEdward Thomson2022-01-271-2/+2
| | | | | Deprecate the `git_packfile_hash` function. Callers should use the new `git_packfile_name` function which provides a unique packfile name.
* cmake: refactor global variablesEdward Thomson2021-11-141-7/+7
| | | | | Update the global variables `LIBGIT2_OBJECTS` to `LIBGIT2_DEPENDENCY_OBJECTS` for clarity and consistency.
* fuzzers: declare static functions as staticEdward Thomson2021-11-112-4/+4
|
* fuzzers: declare standalone functionsEdward Thomson2021-11-119-2/+29
|
* cmake: move fuzzer args to the fuzzer's cmakeEdward Thomson2021-11-111-0/+3
|
* path: separate git-specific path functions from utilEdward Thomson2021-11-091-1/+1
| | | | | | Introduce `git_fs_path`, which operates on generic filesystem paths. `git_path` will be kept for only git-specific path functionality (for example, checking for `.git` in a path).
* libgit2_clar is now libgit2_testsMartin Kühl2021-10-281-3/+3
| | | | | | in #6083 the test runner was renamed to libgit2_tests, but not all references to the old name were updated. this change changes all of them to use the new name.
* cmake: stylistic refactoringEdward Thomson2021-10-181-19/+19
| | | | | Ensure that we always use lowercase function names, and that we do not have spaces preceding open parentheses, for consistency.
* cmake: BUILD_CLAR is now BUILD_TESTSethomson/clar_no_moreEdward Thomson2021-10-171-2/+2
| | | | | Nobody knows what CLAR is. The test building option should be `BUILD_TESTS`.
* str: introduce `git_str` for internal, `git_buf` is externalethomson/gitstrEdward Thomson2021-10-174-23/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | libgit2 has two distinct requirements that were previously solved by `git_buf`. We require: 1. A general purpose string class that provides a number of utility APIs for manipulating data (eg, concatenating, truncating, etc). 2. A structure that we can use to return strings to callers that they can take ownership of. By using a single class (`git_buf`) for both of these purposes, we have confused the API to the point that refactorings are difficult and reasoning about correctness is also difficult. Move the utility class `git_buf` to be called `git_str`: this represents its general purpose, as an internal string buffer class. The name also is an homage to Junio Hamano ("gitstr"). The public API remains `git_buf`, and has a much smaller footprint. It is generally only used as an "out" param with strict requirements that follow the documentation. (Exceptions exist for some legacy APIs to avoid breaking callers unnecessarily.) Utility functions exist to convert a user-specified `git_buf` to a `git_str` so that we can call internal functions, then converting it back again.
* fuzzers: use updated hash functionsethomson/oidEdward Thomson2021-10-022-6/+12
|
* commit-graph: Create `git_commit_graph` as an abstraction for the filelhchavez2021-03-101-5/+5
| | | | | | | | | | This change does a medium-size refactor of the git_commit_graph_file and the interaction with the ODB. Now instead of the ODB owning a direct reference to the git_commit_graph_file, there will be an intermediate git_commit_graph. The main advantage of that is that now end users can explicitly set a git_commit_graph that is eagerly checked for errors, while still being able to lazily use the commit-graph in a regular ODB, if the file is present.
* commit-graph: Support lookups of entries in a commit-graphlhchavez2021-01-101-0/+5
| | | | | | | | | | This change introduces `git_commit_graph_entry_find()` and `git_commit_graph_entry_parent()`. These two functions allow a much faster lookup of commits by ID, since the ODB does not need to be consulted, the commit object does not need to be inflated, and the contents of the commit object do not need to be parsed. Part of: #5757
* commit-graph: Introduce a parser for commit-graph fileslhchavez2021-01-10514-0/+80
| | | | | | | | This change is the first in a series to add support for git's commit-graph. This should speed up commit graph traversals by avoiding object parsing and allowing some operations to terminate earlier. Part of: #5757
* multipack: Introduce a parser for multi-pack-index fileslhchavez2020-10-05442-0/+107
| | | | | | | This change is the first in a series to add support for git's multi-pack-index. This should speed up large repositories significantly. Part of: #5399
* fuzzers: add a new fuzzer for patch parsingAugie Fackler2019-10-173-0/+96
| | | | | I was looking at this code anyway because the sr.ht people nerdsniped me, and it gave me that "I should fuzz this" feeling. So have a fuzzer!
* Merge pull request #5141 from pks-t/pks/azure-drop-powershellPatrick Steinhardt2019-07-211-0/+4
|\ | | | | azure: drop powershell
| * fuzzers: provide test targetsPatrick Steinhardt2019-07-201-0/+4
| | | | | | | | | | | | Instead of having to find the fuzzer executables in our Azure test scripts, provide test targets for each of our fuzzers that will run them with the correct paths.
* | fuzzer: use futils instead of fileopsethomson/futilsEdward Thomson2019-07-201-1/+1
| |
* | fileops: rename to "futils.h" to match function signaturesPatrick Steinhardt2019-07-201-1/+1
|/ | | | | | | | | Our file utils functions all have a "futils" prefix, e.g. `git_futils_touch`. One would thus naturally guess that their definitions and implementation would live in files "futils.h" and "futils.c", respectively, but in fact they live in "fileops.h". Rename the files to match expectations.
* fuzzers: clean up header includesPatrick Steinhardt2019-07-054-18/+2
| | | | | | There's multiple headers included in our fuzzers that aren't required at all. Furthermore, some of them are not available on Win32, causing builds to fail. Remove them to fix this.
* fuzzers: use `git_buf_printf` instead of `snprintf`Patrick Steinhardt2019-07-051-16/+15
| | | | | | The `snprintf` function does not exist on Win32, it only has `_snprintf_s` available. Let's just avoid any cross-platform hassle and use our own `git_buf` functionality instead.
* fuzzers: use POSIX emulation layer to unlink filesPatrick Steinhardt2019-07-051-7/+7
| | | | | | Use `p_unlink` instead of `unlink` to remove the generated packfiles in our packfile fuzzer. Like this, we do not have to worry about using proper includes that are known on all platforms, especially Win32.
* fuzzers: make printf formatters cross-platform compatiblePatrick Steinhardt2019-07-051-2/+3
| | | | | | | | The `printf` formatters in our standalone fuzzing driver are currently using the "%m" specifier, which is a GNU extension that prints the error message for the error code in `errno`. As we're using libgit2 functions in both cases anyway, let's just use `git_error_last` instead to make this valid on all platforms.
* fuzzers: implement `mkdtemp` alternative for Win32Patrick Steinhardt2019-07-051-6/+20
| | | | | | The `mkdtemp` function is not available on Windows, so our download_refs fuzzer will fail to compile on Windows. Provide an alternative implementation to fix it.
* fuzzers: use system includesEdward Thomson2019-05-191-0/+1
| | | | | | Use the system includes (defined by libgit2) as the fuzzer includes. The fuzzers link against internal libgit2 API and therefore need to have the full include path that libgit2 uses.
* indexer: use git_indexer_progress throughoutEdward Thomson2019-02-221-1/+1
| | | | | Update internal usage of `git_transfer_progress` to `git_indexer_progreses`.
* fuzzers: don't use deprecated typesEdward Thomson2019-01-251-1/+1
|
* errors: remove giterr usage in fuzzersEdward Thomson2019-01-222-2/+2
|
* object_type: convert final internal users to new namesethomson/git_objEdward Thomson2019-01-172-3/+3
| | | | | Update some missed types that were continuing to use the old `GIT_OBJ` names.
* Merge pull request #4845 from pks-t/pks/object-fuzzerCarlos Martín Nieto2018-10-156-0/+439
|\ | | | | Object parsing fuzzer
| * fuzzers: add object parsing fuzzerPatrick Steinhardt2018-10-115-0/+432
| | | | | | | | | | | | Add a simple fuzzer that exercises our object parser code. The fuzzer is quite trivial in that it simply passes the input data directly to `git_object__from_raw` for each of the four object types.
| * fuzzers: initialize libgit2 in standalone driverPatrick Steinhardt2018-10-111-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The standalone driver for libgit2's fuzzing targets makes use of functions from libgit2 itself. While this is totally fine to do, we need to make sure to always have libgit2 initialized via `git_libgit2_init` before we call out to any of these. While this happens in most cases as we call `LLVMFuzzerInitialize`, which is provided by our fuzzers and which right now always calls `git_libgit2_init`, one exception to this rule is our error path when not enough arguments have been given. In this case, we will call `git_vector_free_deep` without libgit2 having been initialized. As we did not set up our allocation functions in that case, this will lead to a segmentation fault. Fix the issue by always initializing and shutting down libgit2 in the standalone driver. Note that we cannot let this replace the initialization in `LLVMFuzzerInitialize`, as it is required when using the "real" fuzzers by LLVM without our standalone driver. It's no problem to call the initialization and deinitialization functions multiple times, though.
* | Apply code review feedbackNelson Elhage2018-10-111-7/+4
| |
* | fuzzers: Port config_file_fuzzer to the new in-memory backendNelson Elhage2018-10-091-25/+18
|/
* fuzzer: update for indexer changesethomson/fuzzerEdward Thomson2018-08-261-1/+1
|
* Add a proper write loopNelson Elhage2018-08-161-2/+10
|
* Add a copyright header.Nelson Elhage2018-08-141-0/+9
|
* Further review comments, fix the buildNelson Elhage2018-08-141-11/+27
|
* ReformatNelson Elhage2018-08-141-27/+28
|
* Add a config file to the corpusNelson Elhage2018-08-051-0/+11
|