netif-util: fix stack-use-after-scope

Fixes a bug introduced by 0295b2fd1d.

Fixes #21292.
This commit is contained in:
Yu Watanabe
2021-11-10 22:11:18 +00:00
committed by Frantisek Sumsal
parent 8b212f3596
commit 9133c1877f
+2 -4
View File
@@ -67,7 +67,7 @@ int net_get_unique_predictable_data(sd_device *device, bool use_sysname, uint64_
log_device_debug(device, "Using \"%s\" as stable identifying information", name);
return net_get_unique_predictable_data_from_name(name, NULL, ret);
return net_get_unique_predictable_data_from_name(name, &HASH_KEY, ret);
}
int net_get_unique_predictable_data_from_name(
@@ -80,11 +80,9 @@ int net_get_unique_predictable_data_from_name(
int r;
assert(name);
assert(key);
assert(ret);
if (!key)
key = &HASH_KEY;
l = strlen(name);
sz = sizeof(sd_id128_t) + l;
v = newa(uint8_t, sz);