<rdar://problem/7239579> WAB/BTMM: Wrong RData length used for TXT record when domain...
authorrlpm@apple.com <rlpm@apple.com@214c2c4a-bf3b-4dcf-9390-e4dd3010487d>
Mon, 21 Sep 2009 17:54:20 +0000 (17:54 +0000)
committerrlpm@apple.com <rlpm@apple.com@214c2c4a-bf3b-4dcf-9390-e4dd3010487d>
Mon, 21 Sep 2009 17:54:20 +0000 (17:54 +0000)
- Set the servicereg.txtlen when updating a TXT record, so that the correct length will be used if a new domain is added
- Also removed redundant code setting servicereg.txtdata to NULL when it is already known to be NULL

git-svn-id: http://svn.macosforge.org/repository/mDNSResponder/trunk@6684 214c2c4a-bf3b-4dcf-9390-e4dd3010487d

mDNSShared/uds_daemon.c

index f5cb68c..a5d746a 100644 (file)
@@ -1024,8 +1024,7 @@ mDNSlocal mStatus handle_update_request(request_state *request)
                        if (!request->u.servicereg.txtdata) FatalError("ERROR: handle_update_request - malloc");
                        mDNSPlatformMemCopy(request->u.servicereg.txtdata, rdata, rdlen);
                        }
-               else
-                       request->u.servicereg.txtdata = NULL;
+               request->u.servicereg.txtlen = rdlen;
                }
 
        // update a record from a service record set
@@ -1364,7 +1363,6 @@ mDNSlocal mStatus handle_regservice_request(request_state *request)
                if (!request->u.servicereg.txtdata) FatalError("ERROR: handle_regservice_request - malloc");
                mDNSPlatformMemCopy(request->u.servicereg.txtdata, get_rdata(&request->msgptr, request->msgend, request->u.servicereg.txtlen), request->u.servicereg.txtlen);
                }
-       else request->u.servicereg.txtdata = NULL;
 
        if (!request->msgptr) { LogMsg("%3d: DNSServiceRegister(unreadable parameters)", request->sd); return(mStatus_BadParamErr); }