From: Yu Watanabe Date: Thu, 10 Sep 2020 04:38:31 +0000 (+0900) Subject: network: do not ignore OOM error in wireguard_decode_key_and_warn() X-Git-Tag: v247-rc1~262^2~17 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a8a50f4fb7099f7458dcfc8a801e1b91e4467fc4;p=thirdparty%2Fsystemd.git network: do not ignore OOM error in wireguard_decode_key_and_warn() --- diff --git a/src/network/netdev/wireguard.c b/src/network/netdev/wireguard.c index 5a6eb80d344..314fceb7154 100644 --- a/src/network/netdev/wireguard.c +++ b/src/network/netdev/wireguard.c @@ -492,6 +492,8 @@ static int wireguard_decode_key_and_warn( (void) warn_file_is_world_accessible(filename, NULL, unit, line); r = unbase64mem_full(rvalue, strlen(rvalue), true, &key, &len); + if (r == -ENOMEM) + return log_oom(); if (r < 0) { log_syntax(unit, LOG_WARNING, filename, line, r, "Failed to decode wireguard key provided by %s=, ignoring assignment: %m", lvalue); @@ -526,8 +528,7 @@ int config_parse_wireguard_private_key( w = WIREGUARD(data); assert(w); - (void) wireguard_decode_key_and_warn(rvalue, w->private_key, unit, filename, line, lvalue); - return 0; + return wireguard_decode_key_and_warn(rvalue, w->private_key, unit, filename, line, lvalue); } int config_parse_wireguard_private_key_file(