If encountered a line without RequiredBy or WantedBy the code passes uninitialized pointer to get_install_targets_from_line(). Where it can fail with segfault or silently pass randomly. - Why I did it Uninitialized target_suffix is passed to get_install_targets_from_line() when other fields are present in [Install] section, like this: root@sonic:/home/admin# systemctl cat ntpsec ... [Install] Alias=ntp.service Alias=ntpd.service WantedBy=multi-user.target - How I did it Initialize target_suffix with NULL, put an assert in get_install_targets_from_line(). Edited test to cover this scenario. - How to verify it UT and on the switch. Signed-off-by: Stepan Blyschak <stepanb@nvidia.com> |
||
---|---|---|
.. | ||
debian | ||
tests/testfiles | ||
.gitignore | ||
Makefile | ||
ssg-test.cc | ||
systemd-sonic-generator.c | ||
systemd-sonic-generator.h |