1
0
mirror of https://github.com/systemd/systemd.git synced 2024-12-23 21:35:11 +03:00

Merge pull request #28232 from rpigott/ndisc-captive-portal-mfree

ndisc: clear ndisc captive portal value on bogus zero-len option
This commit is contained in:
Yu Watanabe 2023-07-04 01:27:20 +09:00 committed by GitHub
commit c470513eea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -734,7 +734,7 @@ static int ndisc_router_process_captive_portal(Link *link, sd_ndisc_router *rt)
return r;
if (len == 0) {
mfree(link->ndisc_captive_portal);
link->ndisc_captive_portal = mfree(link->ndisc_captive_portal);
return 0;
}
@ -743,7 +743,7 @@ static int ndisc_router_process_captive_portal(Link *link, sd_ndisc_router *rt)
return r;
if (!in_charset(captive_portal, URI_VALID))
return -EINVAL;
return -EBADMSG;
if (!streq_ptr(link->ndisc_captive_portal, captive_portal)) {
free_and_replace(link->ndisc_captive_portal, captive_portal);