1
0
mirror of https://github.com/systemd/systemd.git synced 2024-12-25 01:34:28 +03:00

resolve: remove always-true superflous check and rename label

Fixes https://github.com/systemd/systemd/security/code-scanning/2900
This commit is contained in:
Luca Boccassi 2024-11-01 13:51:57 +00:00
parent 74a17f875f
commit ffd81a1202

View File

@ -912,7 +912,7 @@ static void vl_method_resolve_service_complete(DnsQuery *query) {
if (r == -ELOOP)
return (void) sd_varlink_error(q->varlink_request, "io.systemd.Resolve.CNAMELoop", NULL);
if (r < 0)
goto finish;
goto fail;
if (r == DNS_QUERY_CNAME) {
/* This was a cname, and the query was restarted. */
TAKE_PTR(q);
@ -924,7 +924,7 @@ static void vl_method_resolve_service_complete(DnsQuery *query) {
DNS_ANSWER_FOREACH_IFINDEX(rr, ifindex, q->answer) {
r = dns_question_matches_rr(question, rr, NULL);
if (r < 0)
goto finish;
goto fail;
if (r == 0)
continue;
@ -942,7 +942,7 @@ static void vl_method_resolve_service_complete(DnsQuery *query) {
q->block_all_complete--;
if (r < 0)
goto finish;
goto fail;
}
found++;
@ -961,11 +961,9 @@ static void vl_method_resolve_service_complete(DnsQuery *query) {
resolve_service_all_complete(TAKE_PTR(q));
return;
finish:
if (r < 0) {
log_error_errno(r, "Failed to send address reply: %m");
(void) sd_varlink_error_errno(q->varlink_request, r);
}
fail:
log_error_errno(r, "Failed to send address reply: %m");
(void) sd_varlink_error_errno(q->varlink_request, r);
}
static int vl_method_resolve_service(sd_varlink* link, sd_json_variant* parameters, sd_varlink_method_flags_t flags, void* userdata) {