]> git.ipfire.org Git - thirdparty/systemd.git/commit
core: skip unit deserialization and move to the next one when unit_deserialize()...
authorFranck Bui <fbui@suse.com>
Tue, 30 Oct 2018 07:05:02 +0000 (08:05 +0100)
committerLennart Poettering <lennart@poettering.net>
Tue, 30 Oct 2018 13:52:13 +0000 (14:52 +0100)
commit651b3b6c923951096894b6fe1ca3b1a6f3b16404
tree79c29fc6c158fa7610215e555dbf0dab183fa2af
parent8cb17a64c4d7a1a1588ada8c7f1432f937d2f0e6
core: skip unit deserialization and move to the next one when unit_deserialize() fails

If unit_deserialize() fails (because one read line is overly long), it returns
an error and we would have assumed that the next read would point to the next
unit to deserialize.

But instead unit_deserialize() can leave the file offset in the middle of a
line.

Therefore we need to ignore and skip the current unit in this case too.

While at it, move unit deserialization in a dedicated functions. That should
make the code easier to read.
src/core/manager.c