xdg-autostart: ignore all empty entries in multi-string entries
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 7 Jul 2020 09:31:17 +0000 (11:31 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 7 Jul 2020 12:02:16 +0000 (14:02 +0200)
commitdea7f5cc8751ab36c75acb7e3d181edef5e73876
tree329f7206f5b0ec43bfc9c3f0b8e7d8184e0683d5
parentd1ca1f7c2ae052e59d0cbe8512e852b9ef059451
xdg-autostart: ignore all empty entries in multi-string entries

The desktop file specification allows entries like ";;;;;;", full of empty strings.
But looking at the actual list of supported keys [1], empty entries are meaningless
(unless we would allow e.g. the desktop name to be the empty string. But that doesn't
seem very useful either). So let's just simplify our life and skip any empty substrings
entirely.

This would also resolve the fuzzer case:
$ valgrind build/fuzz-xdg-desktop test/fuzz/fuzz-xdg-desktop/oss-fuzz-22812
test/fuzz/fuzz-xdg-desktop/oss-fuzz-22812... ok
==2899241== HEAP SUMMARY:
==2899241==     in use at exit: 0 bytes in 0 blocks
==2899241==   total heap usage: 484,385 allocs, 484,385 frees, 12,411,330 bytes allocated

==2899650== HEAP SUMMARY:
==2899650==     in use at exit: 0 bytes in 0 blocks
==2899650==   total heap usage: 1,325 allocs, 1,325 frees, 1,463,602 bytes allocated
src/test/test-xdg-autostart.c
src/xdg-autostart-generator/xdg-autostart-service.c