1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-01-11 05:17:44 +03:00
systemd-stable/test/fuzz
Zbigniew Jędrzejewski-Szmek d1ca1f7c2a xdg-autostart: avoid quadratic behaviour in strv parsing
The fuzzer test case has a giant line with ";;;;;;;;;;;..." which is turned into
a strv of empty strings. Unfortunately, when pushing each string, strv_push() needs
to walk the whole array, which leads to quadratic behaviour. So let's use
greedy_allocation here and also keep location in the string to avoid iterating.

build/fuzz-xdg-desktop test/fuzz/fuzz-xdg-desktop/oss-fuzz-22812  51.10s user 0.01s system 99% cpu 51.295 total
↓
build/fuzz-xdg-desktop test/fuzz/fuzz-xdg-desktop/oss-fuzz-22812  0.07s user 0.01s system 96% cpu 0.083 total

Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=22812.

Other minor changes:
- say "was already defined" instead of "defined multiple times" to make it
  clear that we're ignoring this second definition, and not all definitions
  of the key
- unescaping needs to be done also for the last entry
2020-07-07 12:20:43 +02:00
..
fuzz-bus-message bus-message: avoid dereferencing a NULL pointer 2020-06-22 17:09:49 +02:00
fuzz-calendarspec shared: fix integer overflow in calendarspec 2020-05-15 16:07:29 +02:00
fuzz-catalog catalog: reject entries where the language is too short early 2018-11-29 13:41:40 +09:00
fuzz-dhcp6-client dhcp6: use unaligned_read_be32() 2019-09-20 08:04:15 +00:00
fuzz-dhcp-server fuzz: rename "fuzz-corpus" directory to just "fuzz" 2018-10-02 09:41:25 +02:00
fuzz-dns-packet travis: turn on nonnull-attribute on Fuzzit 2019-06-15 23:12:24 +02:00
fuzz-env-file fuzz: add env-file fuzzer 2019-03-11 14:11:28 +01:00
fuzz-fido-id-desc udev: Add id program and rule for FIDO security tokens 2019-09-07 02:23:58 +09:00
fuzz-journal-remote journal: fix buffer overrun when urlifying 2020-06-25 08:51:21 +02:00
fuzz-journald-audit journald: check whether sscanf has changed the value corresponding to %n 2018-11-17 11:25:19 +01:00
fuzz-journald-kmsg tests: add a reproducer for a heap-buffer-overflow fixed in 937b117137 2018-11-16 08:45:16 +01:00
fuzz-journald-native-fd tests: add a fuzzer for server_process_native_file 2018-11-23 17:29:59 +01:00
fuzz-journald-stream tests: add a fuzzer for journald streams 2018-11-20 03:03:32 +01:00
fuzz-journald-syslog fuzz: unify the "fuzz-regressions" directory with the main corpus 2018-10-02 09:41:25 +02:00
fuzz-json add a test triggering https://github.com/systemd/systemd/issues/15907 2020-05-26 09:01:26 +02:00
fuzz-link-parser link: Allow configuring RX mini and jumbo ring sizes, too 2020-04-29 18:57:13 +02:00
fuzz-lldp tests: add an lldp fuzzer 2018-10-29 15:24:16 +00:00
fuzz-ndisc-rs fuzz: add testcase of oss-fuzz#10734 2018-11-12 02:04:35 +09:00
fuzz-netdev-parser fuzz-netdev-parser: add test case for earlier version of preceding patches 2020-06-22 16:32:37 +02:00
fuzz-network-parser fuzz: add test case that should already be resolved 2020-07-07 10:26:28 +02:00
fuzz-nspawn-oci nspawn-oci: fix double free 2019-03-22 17:39:12 +01:00
fuzz-nspawn-settings fuzz: add testcase for oss-fuzz#13691 2019-03-15 23:54:30 +09:00
fuzz-udev-database fuzz: add a sample for fuzz-udev-database 2019-02-26 13:28:30 +09:00
fuzz-udev-rules fuzz-udev-rules: -ENOBUFS should be accepted too 2020-06-25 08:51:21 +02:00
fuzz-unit-file core: add RootHashSignature service parameter 2020-06-25 08:45:21 +01:00
fuzz-varlink shared/varlink: add missing setting of output_buffer_allocated 2019-05-17 15:09:32 +02:00
fuzz-xdg-desktop xdg-autostart: avoid quadratic behaviour in strv parsing 2020-07-07 12:20:43 +02:00
.gitattributes fuzz: rename "fuzz-corpus" directory to just "fuzz" 2018-10-02 09:41:25 +02:00
meson.build meson: support building fuzzers with meson <0.48.0 2020-05-27 12:27:45 +02:00