Skip to content

Commit

Permalink
resolve: refuse invalid service without type field
Browse files Browse the repository at this point in the history
Fixes Fixes #33935.

(cherry picked from commit b48ab08732a76b7337628e1e716f11c687000903)
(cherry picked from commit 0195db6e919e80bdd6b4b706ebc24d5e935f5422)
(cherry picked from commit 7b1bb6e)
  • Loading branch information
yuwata authored and bluca committed Aug 19, 2024
1 parent 3b1f76d commit bafd8fc
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/resolve/resolved-bus.c
Original file line number Diff line number Diff line change
Expand Up @@ -1135,6 +1135,11 @@ static void resolve_service_all_complete(DnsQuery *query) {
if (r < 0)
goto finish;

if (isempty(type)) {
r = reply_method_errorf(q, BUS_ERROR_NO_SUCH_SERVICE, "'%s' does not provide valid service", dns_query_string(q));
goto finish;
}

r = sd_bus_message_append(
reply,
"ssst",
Expand Down

0 comments on commit bafd8fc

Please sign in to comment.