prepare-root: Properly check return value of snprintf()
authorUwe Kleine-König <u.kleine-koenig@baylibre.com>
Fri, 6 Feb 2026 11:56:25 +0000 (12:56 +0100)
committerColin Walters <walters@verbum.org>
Fri, 31 Jul 2026 11:44:20 +0000 (07:44 -0400)
commitfeaec164ea5b29e90c3f386da43ec731831650e5
treebab2a90526429bd228372990ccf64c84d33086a1
parentdb99a158254284e5228a59e5dea81de5c6c417e7
prepare-root: Properly check return value of snprintf()

When the target buffer is to small to hold the resulting string a value
larger or equal than the buffer's size is returned. (In pre C99
versions, snprintf returned -1 in this case, too.)

So to ensure that no truncated paths are used adapt the error checking
accordingly.
src/switchroot/ostree-prepare-root-static.c