summaryrefslogtreecommitdiffstats
path: root/avahi-compat-libdns_sd/compat.c
diff options
context:
space:
mode:
authorTrent Lloyd <lathiat@bur.st>2006-12-28 15:45:29 +0000
committerTrent Lloyd <lathiat@bur.st>2006-12-28 15:45:29 +0000
commitc9109b4b6f4eca16ad867d91bd6683ac6355be76 (patch)
treed544a9e920f7d6f4017c48523ff80acec595a7a5 /avahi-compat-libdns_sd/compat.c
parent7a237191fe9521c625dee2f09accb7574edd6b4f (diff)
* 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
Diffstat (limited to 'avahi-compat-libdns_sd/compat.c')
-rw-r--r--avahi-compat-libdns_sd/compat.c19
1 files changed, 14 insertions, 5 deletions
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) {