summaryrefslogtreecommitdiff
path: root/src/fuzz/fuzz-compress.c
Commit message (Collapse)AuthorAgeFilesLines
* compress: replace compress_blob() with compress_blob_explicit()Yu Watanabe2023-04-111-1/+1
| | | | | | | And make compress_xyz() return 0 on success, as we know which compression algorithm is used when calling compress_blob(). Follow-up for 2360352ef02548723ac0c8eaf5ff6905eb9eeca5.
* fuzz: fuzz-compress: fix copy-and-paste error: buf -> buf2 (#25431)Li kunyu2022-11-181-1/+1
|
* compress: make Compression a regular non-sparse enumLennart Poettering2022-04-261-1/+1
| | | | | | | Given we have two different types for the journal object flags and the Compression enum, let's make the latter a regular non-sparse enum, and thus remove some surprises. We have to convert anyway between the two, and already do via COMPRESSION_FROM_OBJECT().
* basic: move compress.[ch] → src/basic/Lennart Poettering2022-04-261-16/+5
| | | | | | | | | | | | The compression helpers are used both in journal code and in coredump code, and there's a good chance we'll use them later for other stuff. Let's hence move them into src/basic/, to make them a proper internal API we can use from everywhere where that's desirable. (pstore might be a candidate, for example) No real code changes, just some moving around, build system rearrangements, and stripping of journal-def.h inclusion.
* alloc-util: simplify GREEDY_REALLOC() logic by relying on malloc_usable_size()Lennart Poettering2021-05-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | We recently started making more use of malloc_usable_size() and rely on it (see the string_erase() story). Given that we don't really support sytems where malloc_usable_size() cannot be trusted beyond statistics anyway, let's go fully in and rework GREEDY_REALLOC() on top of it: instead of passing around and maintaining the currenly allocated size everywhere, let's just derive it automatically from malloc_usable_size(). I am mostly after this for the simplicity this brings. It also brings minor efficiency improvements I guess, but things become so much nicer to look at if we can avoid these allocation size variables everywhere. Note that the malloc_usable_size() man page says relying on it wasn't "good programming practice", but I think it does this for reasons that don't apply here: the greedy realloc logic specifically doesn't rely on the returned extra size, beyond the fact that it is equal or larger than what was requested. (This commit was supposed to be a quick patch btw, but apparently we use the greedy realloc stuff quite a bit across the codebase, so this ends up touching *a*lot* of code.)
* license: LGPL-2.1+ -> LGPL-2.1-or-laterYu Watanabe2020-11-091-1/+1
|
* fuzz-compress: add fuzzer for compression and decompressionZbigniew Jędrzejewski-Szmek2018-10-301-0/+80