1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-03-10 00:58:20 +03:00

dissect-image: don#t mix two forms of stack allocation in one expression

It's not necessarily safe to do this, hence don't.
This commit is contained in:
Lennart Poettering 2021-03-08 17:31:47 +01:00
parent 7533a33b0c
commit 794a579f29

View File

@ -2272,7 +2272,9 @@ int dissected_image_acquire_metadata(DissectedImage *m) {
/* As per the os-release spec, if the image is an extension it will have a file
* named after the image name in extension-release.d/ */
if (m->image_name) {
char *ext = strjoina("/usr/lib/extension-release.d/extension-release.", m->image_name, "0");
char *ext;
ext = strjoina("/usr/lib/extension-release.d/extension-release.", m->image_name, "0");
ext[strlen(ext) - 1] = '\0'; /* Extra \0 for NULSTR_FOREACH using placeholder from above */
paths[META_EXTENSION_RELEASE] = ext;
} else