mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-01-25 06:03:40 +03:00
fstab-generator: use str(n)dupa_safe() instead of plain str(n)dupa()
This commit is contained in:
parent
e46c743a57
commit
ea1c9d3f69
@ -721,7 +721,7 @@ static int sysroot_is_nfsroot(void) {
|
|||||||
if (!sep)
|
if (!sep)
|
||||||
return -EINVAL;
|
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);
|
r = in_addr_from_string(AF_INET6, a, &u);
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
@ -733,7 +733,7 @@ static int sysroot_is_nfsroot(void) {
|
|||||||
/* IPv4 address */
|
/* IPv4 address */
|
||||||
sep = strchr(arg_root_what, ':');
|
sep = strchr(arg_root_what, ':');
|
||||||
if (sep) {
|
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)
|
if (in_addr_from_string(AF_INET, a, &u) >= 0)
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user