1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-08-30 05:50:12 +03:00

network: do not reallocate buffer

This commit is contained in:
Yu Watanabe
2020-08-28 12:53:08 +09:00
parent d0ac05613b
commit 9d6282d120

View File

@ -1340,17 +1340,21 @@ int routing_policy_load_rules(const char *state_file, Set **rules) {
return r; return r;
for (;;) { for (;;) {
_cleanup_free_ char *word = NULL, *a = NULL, *b = NULL; _cleanup_free_ char *a = NULL;
char *b;
r = extract_first_word(&p, &word, NULL, 0); r = extract_first_word(&p, &a, NULL, 0);
if (r < 0) if (r < 0)
return r; return r;
if (r == 0) if (r == 0)
break; break;
r = split_pair(word, "=", &a, &b); b = strchr(a, '=');
if (r < 0) if (!b) {
log_warning_errno(r, "Failed to parse RPDB rule, ignoring: %s", a);
continue; continue;
}
*b++ = '\0';
if (STR_IN_SET(a, "from", "to")) { if (STR_IN_SET(a, "from", "to")) {
union in_addr_union *buffer; union in_addr_union *buffer;