]> git.ipfire.org Git - thirdparty/systemd.git/commit
util: Fix assertion in split() on missing '
authorMartin Pitt <martin.pitt@ubuntu.com>
Wed, 22 Apr 2015 22:09:43 +0000 (23:09 +0100)
committerLennart Poettering <lennart@poettering.net>
Wed, 22 Apr 2015 23:14:07 +0000 (01:14 +0200)
commit470dca63cd2b1579f45f72b6b9777494abeff105
tree44fac9a4cf37e9b4841160a9d2f1a88536b1ff8f
parent0674bbea9ce0958512411962c2d1623d88dad0b4
util: Fix assertion in split() on missing '

When parsing a unit with a trailing slash after an escaped line break, like

  ExecStart=/bin/echo 'foo \
    bar'

the split() function (through config_parse()) asserted and crashed pid 1:

  Assertion 'current[*l + 1] == quotechars[0]' failed at ../src/shared/util.c:583, function split(). Aborting.

Fix this by returning an error in this case ("trailing garbage").

Add corresponding test case. Also fix the missing "unit" argument of
config_parse_exec() in the comment.

https://launchpad.net/bugs/1447243
src/shared/util.c
src/test/test-unit-file.c