summaryrefslogtreecommitdiffstats
path: root/src/fstab-generator
diff options
context:
space:
mode:
authorFrantisek Sumsal <frantisek@sumsal.cz>2022-01-29 22:34:02 +0100
committerFrantisek Sumsal <frantisek@sumsal.cz>2022-01-29 22:34:02 +0100
commitea1c9d3f69f41c86a55e40e110d394769f5803f3 (patch)
tree4b59f444f0eb8b8a00480a0a7f3cba35b346d02b /src/fstab-generator
parentci: update GHActions once a month (diff)
downloadsystemd-ea1c9d3f69f41c86a55e40e110d394769f5803f3.tar.xz
systemd-ea1c9d3f69f41c86a55e40e110d394769f5803f3.zip
fstab-generator: use str(n)dupa_safe() instead of plain str(n)dupa()
Diffstat (limited to 'src/fstab-generator')
-rw-r--r--src/fstab-generator/fstab-generator.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/fstab-generator/fstab-generator.c b/src/fstab-generator/fstab-generator.c
index 9b32383a76..ca9b045e85 100644
--- a/src/fstab-generator/fstab-generator.c
+++ b/src/fstab-generator/fstab-generator.c
@@ -721,7 +721,7 @@ static int sysroot_is_nfsroot(void) {
if (!sep)
return -EINVAL;
- a = strndupa(arg_root_what + 1, sep - arg_root_what - 1);
+ a = strndupa_safe(arg_root_what + 1, sep - arg_root_what - 1);
r = in_addr_from_string(AF_INET6, a, &u);
if (r < 0)
@@ -733,7 +733,7 @@ static int sysroot_is_nfsroot(void) {
/* IPv4 address */
sep = strchr(arg_root_what, ':');
if (sep) {
- a = strndupa(arg_root_what, sep - arg_root_what);
+ a = strndupa_safe(arg_root_what, sep - arg_root_what);
if (in_addr_from_string(AF_INET, a, &u) >= 0)
return true;