1*5082cc7fSAndrew GeisslerFrom 46490e95151d415cd22f02565e530eb5efcef680 Mon Sep 17 00:00:00 2001 2*5082cc7fSAndrew GeisslerFrom: Asger Hautop Drewsen <asger@princh.com> 3*5082cc7fSAndrew GeisslerDate: Mon, 9 Aug 2021 14:25:08 +0200 4*5082cc7fSAndrew GeisslerSubject: [PATCH] Fix avahi-browse: Invalid service type 5*5082cc7fSAndrew Geissler 6*5082cc7fSAndrew GeisslerInvalid service types will stop the browse from completing, or 7*5082cc7fSAndrew Geisslerin simple terms "my washing machine stops me from printing". 8*5082cc7fSAndrew Geissler 9*5082cc7fSAndrew GeisslerUpstream-Status: Submitted [https://github.com/lathiat/avahi/pull/472] 10*5082cc7fSAndrew GeisslerSigned-off-by: Ross Burton <ross.burton@arm.com> 11*5082cc7fSAndrew Geissler--- 12*5082cc7fSAndrew Geissler avahi-core/browse-service.c | 4 +++- 13*5082cc7fSAndrew Geissler 1 file changed, 3 insertions(+), 1 deletion(-) 14*5082cc7fSAndrew Geissler 15*5082cc7fSAndrew Geisslerdiff --git a/avahi-core/browse-service.c b/avahi-core/browse-service.c 16*5082cc7fSAndrew Geisslerindex 63e0275a..ac3d2ecb 100644 17*5082cc7fSAndrew Geissler--- a/avahi-core/browse-service.c 18*5082cc7fSAndrew Geissler+++ b/avahi-core/browse-service.c 19*5082cc7fSAndrew Geissler@@ -103,7 +103,9 @@ AvahiSServiceBrowser *avahi_s_service_browser_prepare( 20*5082cc7fSAndrew Geissler AVAHI_CHECK_VALIDITY_RETURN_NULL(server, AVAHI_PROTO_VALID(protocol), AVAHI_ERR_INVALID_PROTOCOL); 21*5082cc7fSAndrew Geissler AVAHI_CHECK_VALIDITY_RETURN_NULL(server, !domain || avahi_is_valid_domain_name(domain), AVAHI_ERR_INVALID_DOMAIN_NAME); 22*5082cc7fSAndrew Geissler AVAHI_CHECK_VALIDITY_RETURN_NULL(server, AVAHI_FLAGS_VALID(flags, AVAHI_LOOKUP_USE_WIDE_AREA|AVAHI_LOOKUP_USE_MULTICAST), AVAHI_ERR_INVALID_FLAGS); 23*5082cc7fSAndrew Geissler- AVAHI_CHECK_VALIDITY_RETURN_NULL(server, avahi_is_valid_service_type_generic(service_type), AVAHI_ERR_INVALID_SERVICE_TYPE); 24*5082cc7fSAndrew Geissler+ 25*5082cc7fSAndrew Geissler+ if (!avahi_is_valid_service_type_generic(service_type)) 26*5082cc7fSAndrew Geissler+ service_type = "_invalid._tcp"; 27*5082cc7fSAndrew Geissler 28*5082cc7fSAndrew Geissler if (!domain) 29*5082cc7fSAndrew Geissler domain = server->domain_name; 30