From: Trent Lloyd Date: Thu, 28 Dec 2006 15:45:29 +0000 (+0000) Subject: * Gracefully handle some conditions in libdns_sd that Bonjour handles X-Git-Url: https://git.meshlink.io/?a=commitdiff_plain;h=c9109b4b6f4eca16ad867d91bd6683ac6355be76;p=catta * Gracefully handle some conditions in libdns_sd that Bonjour handles (Closes #64) git-svn-id: file:///home/lennart/svn/public/avahi/trunk@1345 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe --- diff --git a/avahi-compat-libdns_sd/compat.c b/avahi-compat-libdns_sd/compat.c index e6b6042..9dc2281 100644 --- a/avahi-compat-libdns_sd/compat.c +++ b/avahi-compat-libdns_sd/compat.c @@ -610,10 +610,13 @@ DNSServiceErrorType DNSSD_API DNSServiceBrowse( struct type_info type_info; AVAHI_WARN_LINKAGE; - - assert(ret_sdref); + + if (!ret_sdref) + return kDNSServiceErr_BadParam; + + *ret_sdref = NULL; + assert(regtype); - assert(callback); if (interface == kDNSServiceInterfaceIndexLocalOnly || flags != 0) { AVAHI_WARN_UNSUPPORTED; @@ -1091,8 +1094,14 @@ DNSServiceErrorType DNSSD_API DNSServiceRegister ( AVAHI_WARN_LINKAGE; - assert(ret_sdref); - assert(regtype); + if (!ret_sdref) + return kDNSServiceErr_BadParam; + + *ret_sdref = NULL; + + if (!regtype) + return kDNSServiceErr_BadParam; + assert(txtRecord || txtLen == 0); if (interface == kDNSServiceInterfaceIndexLocalOnly || flags) {