diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2022-05-21 03:03:21 +0900 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2022-05-21 06:37:56 +0900 |
commit | 30e29edf4c0bb025aa7dc03c415b727fddf996ac (patch) | |
tree | c25bdb54aa8c5b68135ac0af064a33326fd60b10 /src/sysext/sysext.c | |
parent | 1f97c2da0c5e318117e3f8b30159f5bd53a48f89 (diff) | |
download | systemd-30e29edf4c0bb025aa7dc03c415b727fddf996ac.tar.gz |
sysext: refuse empty release ID to avoid triggering assertion
Otherwise, the assertion in extension_release_validate() will be
triggered.
Diffstat (limited to 'src/sysext/sysext.c')
-rw-r--r-- | src/sysext/sysext.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/sysext/sysext.c b/src/sysext/sysext.c index 76c2fe6978..364af195e0 100644 --- a/src/sysext/sysext.c +++ b/src/sysext/sysext.c @@ -478,6 +478,10 @@ static int merge_subprocess(Hashmap *images, const char *workspace) { "SYSEXT_LEVEL", &host_os_release_sysext_level); if (r < 0) return log_error_errno(r, "Failed to acquire 'os-release' data of OS tree '%s': %m", empty_to_root(arg_root)); + if (isempty(host_os_release_id)) + return log_error_errno(SYNTHETIC_ERRNO(EINVAL), + "'ID' field not found or empty in 'os-release' data of OS tree '%s': %m", + empty_to_root(arg_root)); /* Let's now mount all images */ HASHMAP_FOREACH(img, images) { |